Skip to content

Latest commit

 

History

History
20 lines (11 loc) · 584 Bytes

exercise_3.md

File metadata and controls

20 lines (11 loc) · 584 Bytes

Unit 4 Practice

Exercise 3 - Flip the Numbers

Use a loop to create a list of 10 random numbers between -100 and 100.

3.1

Loop through the list of numbers and switch each number to its opposite sign. Negatives become positives, positives become negatives.

numbers: [10, -36, 6, -39, -96, 13, -35, 83, -52, 86]
flipped: [-10, 36, -6, 39, 96, -13, 35, -83, 52, -86]

Exercise 3 solution