10000 nested loops · dsabhrawal/python-examples@3d82ce1 · GitHub
[go: up one dir, main page]

Skip to content

Commit 3d82ce1

Browse files
Deepak SabhrawalDeepak Sabhrawal
authored andcommitted
nested loops
1 parent e15a4cb commit 3d82ce1

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

ControlStatments/LoopStatements.py

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,3 +42,23 @@
4242

4343
#Result: 11
4444

45+
#Nested Loops
46+
for x in range(4):
47+
for y in range(3):
48+
print(f'({x}),({y})')
49+
50+
#Output
51+
'''
52+
(0),(0)
53+
(0),(1)
54+
(0),(2)
55+
(1),(0)
56+
(1),(1)
57+
(1),(2)
58+
(2),(0)
59+
(2),(1)
60+
(2),(2)
61+
(3),(0)
62+
(3),(1)
63+
(3),(2)
64+
'''

0 commit comments

Comments
 (0)
0