-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathNestedloop.py
More file actions
41 lines (30 loc) · 844 Bytes
/
Nestedloop.py
File metadata and controls
41 lines (30 loc) · 844 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
38
39
40
41
#Nested loop = A loop within another loop (outer, inner)
#outer loop:
#inner loop:
#Sample of loops
#x = -1
#y = 5
#while x > 0:
# while y > 0:
# print("Do Nothing")
#for x in range(3):
# for y in range(9):
# print("Do Nothing")
#while x > 0:
# for y in range(9):
# print("Do Nothing")
#for x in range(3):
# while y > 0:
# print("Do Nothing")
#for x in range(3):
# for y in range(1, 10): #10 is exclusive
# print(y, end =" - ")
# print()
#print rectangle
rows = int(input("Enter the number of rows: "))
columns = int(input("Enter the number of columns: "))
symbol = input("Enter a symbol to use: ")
for x in range(rows):
for y in range(columns): #10 is exclusive
print(symbol, end ="")
print()