0
Solve this I have got stuck in it
#installed games games = [ 'Soccer', 'Tic Tac Toe', 'Snake', 'Puzzle', 'Rally'] #taking player's choice as a number input choice = int(input("")) #output the corresponding game
9 Respuestas
+ 2
Well the user gives the number, and you can have the input statement like -
choice = int(input("Enter 0 for soccer, 1 for Tic Tac Toe, 2 for Snake, 3 for Puzzle or 4 for Rally")
Then you just do -
Print(games[choice])
+ 3
Angelo Abi Hanna Please try to avoid giving direct answers, especially with no explaination.
+ 1
Justice sorry, i was just trying to help, but note that the code i gave is still missing error handling
+ 1
Try this
#output the corresponding game
print ( games [ choice - 1 ] )
0
choice = int(input())
selected = games[choice - 1]
print(selected)
0
#or just write
print(games[int(input())-1])
0
games = [
'Soccer', 'Tic Tac Toe', 'Snake',
'Puzzle', 'Rally']
choice = int(input())
print(games[choice])
0
I don't know.... 😅