Q:

nested for loop in python

for i in range(5):
  for j in range(i):
    # you can add many for loops or you can just write any code
2
adj = ["red", "big", "tasty"]
fruits = ["apple", "banana", "cherry"]

for x in adj:
  for y in fruits:
    print(x, y)
3
user_input = int(input("Enter table shape"))
for i in range(user_input):
    for j in range(user_input):
        k = i + j
        print(k, end = "  ")
    print()
0

New to Communities?

Join the community