Skip to content

Latest commit

 

History

History
 
 

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 

07 D0 While

DO DO DO The while() function is another loop example in python is less commonly used but it is a loop.

x = 1
while x < 6:
  print(x)
  x += 1

📝 Instructions:

  1. Print every iteration number on the console from 20 to 1, but concatenate an exclamation point to the output if the number is a multiple of 5.

  2. At the end print() LIFTOFF.

💡 Hint:

Expected result:

Example Output on the console:

20!
19
18
17
16
15!
14
13
12
11
10!
.
.
1
LIFTOFF