Skip to content

Latest commit

 

History

History
37 lines (23 loc) · 741 Bytes

exercise_1.md

File metadata and controls

37 lines (23 loc) · 741 Bytes

Unit 5 Practice

Exercise 1 - Count Sheep

It's past your bedtime! Let's count some sheep to lull you to sleep.

1.1

  • Generate a random number between 1 and 10 to represent the number of sheep needed to fall asleep.

  • Set a variable called awake to True

  • Using a while loop, count sheep until you fall asleep

  • Fall asleep by setting awake to False

Output

1 sheep - baa!
2 sheep - baa!
3 sheep - baa!
4 sheep - baa!
5 sheep - baa!
6 sheep - baa!
7 sheep - baa!
8 sheep - baa!
9 sheep - baa!

...zZzZzZzZ...

Exercise 1 solution