Skip to content

Python index list out of range on 3.10 V studio and python 3.10 for row in range enumerate #2

@leronOthesideofEggs

Description

@leronOthesideofEggs

i followed the youtube video exactly and i even copy pasted the full code stack on git to my VS IDE
it still doesnt work

Message=list index out of range
Source=C:\Users\leron\source\repos\Lottery App\Lottery_App.py
StackTrace:
File "C:\Users\leron\source\repos\Lottery App\Lottery_App.py", line 38, in print_slot_machine
for row in range(len(columns[0])):
File "C:\Users\leron\source\repos\Lottery App\Lottery_App.py", line 110, in main
print_slot_machine(slots)
File "C:\Users\leron\source\repos\Lottery App\Lottery_App.py", line 116, in (Current frame)
main()

def print_slot_machine(columns):
for row in range(len(columns[0])):
for i, column in enumerate (columns):
if i != len(columns) - 1:
print(column[row], end="|" )
else:
print(column[row], end="")

    print()

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions