Python Forum
Choose your own adventure game
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Choose your own adventure game
#1
I get confused when creating these. I want to end the code if you choose one option so that route stops but carry on in the other. Please help.
import time
Gamertag = input("What is your Gamertag? ")
print("Welcome" ,Gamertag)
time.sleep(3)

game = input("Do you want to play a game? ")

if game == "yes":
    print("LOADING... ")

elif game == "no":
    print("Quitting application")
Reply
#2
Your second python tag should have "\".
Then you can fix the indentation, so we see what is going on.
Paul
It is more important to do the right thing, than to do the thing right.(P.Drucker)
Better is the enemy of good. (Montesquieu) = French version for 'kiss'.
Reply
#3
OK, this code does what it is supposed to do.
Paul
It is more important to do the right thing, than to do the thing right.(P.Drucker)
Better is the enemy of good. (Montesquieu) = French version for 'kiss'.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  which Python choose bernd22 1 846 Sep-13-2024, 12:50 PM
Last Post: buran
  Which method name would you choose? Gribouillis 7 1,840 May-30-2024, 07:05 AM
Last Post: buran
  Mac os choose file name howard687 1 2,551 Jan-05-2022, 06:54 AM
Last Post: Larz60+
  Loop with choose Irv1n 5 4,393 Sep-16-2021, 09:31 PM
Last Post: deanhystad
  loop adventure game ilikedofs 1 2,240 May-26-2021, 12:43 AM
Last Post: bowlofred
  how to make a hotkey for text adventure game myn2018 2 2,676 Jan-06-2021, 10:39 PM
Last Post: myn2018
  Choose an element from multidimensional array quest_ 2 3,578 Nov-25-2020, 12:59 AM
Last Post: quest_
  Please help a newbie choose which programming language to learn. yeto 2 4,322 Feb-25-2019, 12:56 AM
Last Post: yeto
  Waiting in a text adventure StickyLizard 1 57,781 Jan-19-2019, 10:45 PM
Last Post: ichabod801
  Errors in simple text adventure game? ecloev 5 6,695 Apr-10-2018, 05:55 PM
Last Post: nilamo

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020