File tree Expand file tree Collapse file tree 1 file changed +18
-5
lines changed Expand file tree Collapse file tree 1 file changed +18
-5
lines changed Original file line number Diff line number Diff line change 7
7
print ("For loops example" )
8
8
print ()
9
9
10
-
11
- print ("Iterating Over a List - start" )
10
+ COMMENT = "Iterating Over a List"
11
+ print (f" { COMMENT } - start" )
12
12
print ()
13
13
14
14
FRUITS = ["banana" , "apple" , "orange" ]
17
17
print (fruit )
18
18
19
19
print ()
20
- print ("Iterating Over a List - finish" )
20
+ print (f"{ COMMENT } - finish" )
21
+ print ("======================================================" )
22
+
23
+ COMMENT = "Using range() to Iterate Over Numbers"
24
+ print (f"{ COMMENT } - start" )
25
+ print ()
26
+
27
+ for i in range (10 ):
28
+ print (i ) # Print 10 numbers starting from 0 (0-9)
29
+
30
+ print ()
31
+ print (f"{ COMMENT } - finish" )
21
32
print ("======================================================" )
22
33
34
+ COMMENT = "Iterating Over a String"
23
35
24
- print ("Using range() to Iterate Over Numbers - start" )
36
+ print (f" { COMMENT } - start" )
25
37
print ()
26
38
27
39
for i in range (10 ):
28
40
print (i ) # Print 10 numbers starting from 0 (0-9)
29
41
30
42
print ()
31
- print ("Using range() to Iterate Over Numbers - finish" )
43
+ print (f" { COMMENT } - finish" )
32
44
print ("======================================================" )
45
+
You can’t perform that action at this time.
0 commit comments