You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Python index list out of range on 3.10 V studio and python 3.10 for row in range enumerate #2
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="")
Activity
mcgunasinghe commentedon Jun 18, 2024
Problem is inside your get_slot_machine_spin(function)
Look this code ... column.append(column)