1.
Q26: What is the output of the following loop?
i = 1
while i <= 3:
j = 1
s = “”
while j <= 3:
s += str(i * j)
print(s, end=” “)
- 111 222 333
- 123 246 369
- 1111 2222 3333
- 1234 2468 36912
- 12 24 36
i = 1
while i <= 3:
j = 1
s = “”
while j <= 3:
s += str(i * j)
print(s, end=” “)
for i in range(1, 5):
for j in range(i):
print(i, end=” “)
numbers = [1, 2, 3]
for number in numbers:
for i in range(1, 4):
print(number ** i, end = “ “)
for i in range(4):
counter = 0
while counter < 4:
print(i, end=” “)
counter += 1
x = [1, 2]
y = [3, 4]
for i in x:
for j in y:
print(“(“ + i + “, “ + j + “)”, end=” “)