print "1 - Pay Calculator" print "2 - Calculator" start = raw_input("Please select your desired program") if int(start) == 1 : try : inp = raw_input("Enter Hours:") hrs = float(inp) inp1 = raw_input('Enter Rate:') rate = float(inp1) inp2 = raw_input("Enter Rate Limit: ") ratelimit = float(inp2) inp3 = raw_input("Enter the overtime rate: ") overtimerate = float(inp3) if hrs <= ratelimit : pay = hrs * rate else : pay = rate * ratelimit + (rate * overtimerate * (hrs - ratelimit)) print "Your final pay is",pay except : print "Enter Numeric Value" if start == 2 : num1 = raw_input("Please enter First number") num2 = raw_input("Please enter Second number") print " 1 = Multiplication" print " 2 = Addition" print " 3 = Subtraction" answer1 = raw_input("Please select desired operation") if answer1 == 1: answer = num1 * num2 print answer if answer1 == 2: answer = num1 + num2 print answer if answer1 == 3: answer = num1 - num2 print answer
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