# Adventure Game Anthony Kucza print ("You are on a quest to slay a dragon.") import random fierceDragon = random.randint(1,2) # print ("Dragon in the sky ", fierceDragon) weaponChoice = 0 while weaponChoice < 1 or weaponChoice > 2: weaponChoice = int(input("Choose weapon 1 or 2: ")) print ("You chose weapon ", weaponChoice) if weaponChoice == fierceDragon: print ("You have selected an ineffective weapon. Watch out.") else: print ("You have slayed the the Dragon. You are safe for now.")
Run
Reset
Share
Import
Link
Embed
Language▼
English
中文
Python Fiddle
Python Cloud IDE
Follow @python_fiddle
Browser Version Not Supported
Due to Python Fiddle's reliance on advanced JavaScript techniques, older browsers might have problems running it correctly. Please download the latest version of your favourite browser.
Chrome 10+
Firefox 4+
Safari 5+
IE 10+
Let me try anyway!
url:
Go
Python Snippet
Stackoverflow Question