+ 4

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?

28th Aug 2023, 6:42 PM
Abood Maswadeh
5 odpowiedzi
+ 10
**🇦🇪|🇦🇪** > it is not seen as very helpful when we are going to post a solution that solves the exercise. > it is more helpful to give hints and tips, so that the op has a chance to find a solution by himself.
29th Aug 2023, 10:35 AM
Lothar
Lothar - avatar
+ 5
Abood Maswadeh review how to use indexing on a list. Use the numeric choice as an index to select the game name.
28th Aug 2023, 6:54 PM
Brian
Brian - avatar
+ 3
Hint: Remember list indexing. :)
30th Aug 2023, 4:08 PM
Darsh srivastava
Darsh srivastava - avatar
+ 2
if the user input 2 the output should be Snake right? how you code this condition maybe : if choice==2: print(games[2]) so what you will change 🧐? maybe games[choice] think about it
28th Aug 2023, 7:29 PM
**🇦🇪|🇦🇪**
**🇦🇪|🇦🇪** - avatar
0
#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 print(games[choice])
1st Mar 2024, 6:28 AM
Demilade Howells
Demilade Howells - avatar