-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathday6.py
More file actions
37 lines (27 loc) · 677 Bytes
/
day6.py
File metadata and controls
37 lines (27 loc) · 677 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
'''
# WHILE Loops
timeLeft = 5
while timeLeft > 0:
print(timeLeft)
timeLeft -= 1 #decrementation
# use a while loop to count from 1 to 10
# after that, print 'BLASTOFF'
count = 1
while count<10:
print(count)
count-=1
print("BLASTOFF")
# FOR Loops
# to loop through a range of numbers
for i in range(2, 30): #(startValue, endValue)
print(i)
# (endValue is not inclusive)
# to loop through at a set interval
for i in range(0,100,5): #(startValue, endValue, skipValue)
print(i)
'''
# paractise:
num = int(input("enter a numba: "))
while num < 10 or num > 20:
num = int(input("enter a numba: "))
print("You have chosen a number in range.")