0
i've been stuck on this python level
i've been stuck on this python level its a python level where you have to make a video game console, and you let the user choose between some games, here is the code: #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 how do i do this?
4 Réponses
+ 8
Kaleab Alemu ,
please do a try by yourself first. HINT:
> to get the required output, we can use the *input number* (int) as an index [...] of the list *games*.
+ 7
You want to output the game of the user's choice so you need to change your print statement.
print(games[0]) should be print(games[choice])
Otherwise it's always going to output Soccer.
+ 2
tag the programming language, not your name
0
while am choose
choice=int(input())
0
print(games[0])
???