0

Help me please for Game machine problem ( in python )

Anyone please help me to solve the problem so that I can move further with my lessons

28th Sep 2023, 1:22 PM
Naveen Bora
Naveen Bora - avatar
11 ответов
+ 4
Read my reply here: https://www.sololearn.com/Discuss/3242472/?ref=app Quoting myself: "choice" is a number and this number is the index of an element in "games". so what you need to do is use "choice" as an index on the "games" list. And print that out!
28th Sep 2023, 1:38 PM
Lisa
Lisa - avatar
+ 4
Novahu Bora , #Don't repeat your own questions.. https://www.sololearn.com/Discuss/3243143/?ref=app #Use only relevant tags instead of `need`. read this about tags.. https://code.sololearn.com/W3uiji9X28C1/?ref=app #Note that,If you're having trouble in code, share your code and then describe what error message you're receiving. without watching no one can figure out what's going wrong.
28th Sep 2023, 1:26 PM
Darpan kesharwani🇮🇳[Inactive📚]
Darpan kesharwani🇮🇳[Inactive📚] - avatar
+ 2
show your updated code. you have "games" and "choice". these are the variables you need to work with.
28th Sep 2023, 2:34 PM
Lisa
Lisa - avatar
+ 2
Naryan Naik Do not give ready-made code. Rather, help the asking person to find the solution themselves and explain the approach.
6th Oct 2023, 12:35 PM
Lisa
Lisa - avatar
+ 1
Hello try this it worked #installed games games = [ 'Soccer', 'Tic Tac Toe', 'Snake', 'Puzzle', 'Rally'] #taking player's choice as a number input choice = int(input()) if choice==0: print(games[0] ) elif choice <=2 : print(games[2]) elif choice>=4: print(games[4])
21st Jul 2024, 12:50 AM
Poja Devi
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
28th Sep 2023, 1:28 PM
Naveen Bora
Naveen Bora - avatar
0
How can I solve it
28th Sep 2023, 1:28 PM
Naveen Bora
Naveen Bora - avatar
0
Thank u lisa but I still can't get it 😥
28th Sep 2023, 1:46 PM
Naveen Bora
Naveen Bora - avatar
0
I got it lisa, thank u for mentoring me
29th Sep 2023, 5:14 AM
Naveen Bora
Naveen Bora - avatar
0
Because iam also doing too much effort for slove this task so i just want to help other people
6th Oct 2023, 12:40 PM
Naryan Naik
Naryan Naik - avatar
0
If they can't get answer someone stop to learn coding also so if they know answer they will continue....
6th Oct 2023, 12:41 PM
Naryan Naik
Naryan Naik - avatar