We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 23e6d11 commit bfc9ec0Copy full SHA for bfc9ec0
codes/session_2/loop.py
@@ -0,0 +1,35 @@
1
+# Open terminal > python3 loop.py
2
+# Start typing below commands and see the output
3
+
4
+animals = ['cat', 'dog', 'racoon']
5
+for a in animals:
6
+ print(a, len(a))
7
8
+print('\n')
9
10
+for i in range(5):
11
+ print(i)
12
13
14
15
+for i in range(5, 10):
16
17
18
19
20
+# (range start, range end, step)
21
+for i in range(0, 10, 3):
22
23
24
25
26
+for i in range(-10, -100, -30):
27
28
29
30
31
+a = ['My', 'name', 'is', 'Ashwin']
32
+for i in range(len(a)):
33
+ print(i, a[i])
34
35
0 commit comments