#Discover what lead is safe in basketball team1_points = int(input("Please enter the first team's points: ")) lead_calculation = float(team1_points -3) has_ball = raw_input("Does the lead team have the ball (Y or N): ") if has_ball == "Y": lead_calculation += 0.5 else: lead_calculation -= 0.5 if lead_calculation < 0: lead_calculation = 0 lead_calculation **= 2 seconds_remain = int(input("Enter the number of seconds remaining: ")) if lead_calculation > seconds_remain: print ("The lead is safe!") else: print ("The lead is not safe.")
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