Skip to content

Latest commit

 

History

History
15 lines (10 loc) · 592 Bytes

exercise.md

File metadata and controls

15 lines (10 loc) · 592 Bytes

Conditionals

Objectives

  1. Generate a random number between 1 and 100
    1. If the number is higher than 50 print "It's closer to 100"
    2. If the number is lower than 50 print "It's closer to 0"
    3. Print the generated random number
  2. Modify the previous code to print "It's 50!" if the random number is 50
  3. Modify the conditional in the code you previously written to check not only if the number is higher than 50 but also if's it's even. If it's even and higher than 50, print "It's closer to 100 and it's even!"

Solution

Click here to view the solution.