def storystart(): name = raw_input("Name, please. ") print"-----------------------------------------------------" print"-----------------------------------------------------" print"------------ESCAPE THE NUCLEAR PLANT-----------------" print"-----------------------------------------------------" print"-----------------------------------------------------" print"Hello, "+ name +" and welcome to the Chernobyl Nuclear Plant." print"You are in a corridor with stairs the left and a hall" print"on the right. Which way do you go?" print"0 for hall/1 for stairs/2 to remain here and look for" d1 = input("a way out.") if d1 == 1: stairs() elif d1 == 0: hallway() else: print"YOU DIED FROM RADIATION EXPOSURE" def stairs(): print"-----------------------------------------------------" print"--------------------STAIRS---------------------------" print"-----------------------------------------------------" def hallway(): print"-----------------------------------------------------" print"---------------------HALL----------------------------" print"-----------------------------------------------------" print"You hear a scream coming from behind a nearby door." db2 = input("Do you 0:investigate or 1:ignore it?") if db2 == 0: print"The stranger in the adjacent room is calling for help." print"He may be infected by a zombie bite." db3 = input("Do you 0:help him/1:ignore him?") if db3 == 0: print"YOU DIED AFTER BEING BITTEN BY A ZOMBIE" else: hallway() elif db2 == 1: escapemethod2() def escapemethod2(): print"-----------------------------------------------------" print"---------------------END-OF-HALL---------------------" print"-----------------------------------------------------" print"You see a hatch and a big red buton in a small room ahead" db4 = ("Do you 0:press the button/1:open the hatch?") if db4 == 0: print"YOU CAUSED THE CHERNOBYL PLANT TO BEGIN A MELTDOWN (AND DIED)" else: print("YOU ESCAPED THE CHERNOBYL PLANT!")
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