import time import random # Delare a variable # Insantiate fuel = 0 combo = random.randrange(900,999) name = "Engine Room" readytoLaunch = False #Use of a Comparision Operator #Check if combo is >= 900 #Check if combo is <= 900 if ((combo >= 900) and (combo <= 999)) print("Combo Cracked!") print("Combo " , combo) print("Fuel Levels Rising") #Use of a Comparision Operator while fuel < 100: fuel += 5 time.sleep(0.5) print("Fuel level:",fuel,"%") #Use of a comparision operator if fuel == 100: print("Fuel Full!") blastOff = True if (blastoff == true): print("Checking fuel Intergrity") #Arithmetic Operators + , / , - , * , % fuel %= 10 if fuel == 0: print("Fuel Interfrity Confirmed\n We are ready to launch!")
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