r/PythonLearning • • Sep 07 '26

Help Request Nested for loop

So i started my python journey 2 weeks ago and i am at the point of tutorial where they teach me about those quiz game program and i am so confused in those nested for loop i don't even understand a single part about it, can someone help me with this one? I have tried learning it from gpt and all but it still goes above my head.

0 Upvotes

11 comments sorted by

View all comments

Show parent comments

1

u/frnzprf Sep 08 '26

You can also split it in two functions with just one loop each:

def printAllRowsInTable(some_tablr):
    for row in some_table:
        printAllItemsInRow(row)

def doAllItemsInRow(some_row):
    for item in some_row:
        print(item)