Can i do a text based game with Python? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 2

Can i do a text based game with Python?

(Sorry for any english error. I'm Brazilian.) i was thinking about creating a game with Python, but im having some Issues. i have some experience with Batch from Windows command prompt, and with him i can make a text based game, but my real problem is that I don't know How to make The player choose something in Python (like type 1 to start, 2 to Help, etc.) wich i can do in Batch with Set /p anithinghere= can someone Help me pls?

21st Jul 2018, 12:22 PM
Kisune
Kisune - avatar
4 Answers
+ 3
If it's just about choosing between options, I find this pattern convenient: print ('choose 1, 2 or 3!') while True: x = input () if x in ('1', '2', '3'): break
21st Jul 2018, 1:25 PM
HonFu
HonFu - avatar
+ 1
You have to use inputs to make text-based games with Python. Just keep learning python. That's all! Happy Coding, and good luck with your game! I bet it will be amazing!
21st Jul 2018, 12:40 PM
Paul Grasser
Paul Grasser - avatar
+ 1
i arealdy done...
28th Jul 2018, 8:31 PM
I Am Arthur
I Am Arthur - avatar
+ 1
Go see my rock paper scissors game
28th Jul 2018, 8:31 PM
I Am Arthur
I Am Arthur - avatar