forked from PrecociouslyDigital/PythonClass
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathLoops.py
32 lines (30 loc) · 728 Bytes
/
Loops.py
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
boolean = True
while boolean:
print ("this loops while the boolean value is true. Given that that boolean doesn't seem to be changing anytime soon, we're going to be stuck here for a while")
#--------------------#
counter = 0
while counter <= 10:
print (counter)
#--------------------#
counter = 0
while counter < 10:
print (counter)
counter = counter + 1
counter = 0
while counter <= 10:
print (counter)
counter = counter + 1
#--------------------#
counter = 0
while counter <= 24:
print (counter)
counter += 2
#--------------------#
list = [1, 2, 8, 4, "Hi"]
for x in list:
print (x)
#--------------------#
for x in range(1, 5):
print (x)
for x in range(1, 10):
print (x)