HourlyRate = float(raw_input("Please input the hourly wage of the employee: \n")) while 18.25 < HourlyRate: print("Error: Employees cannot make less than $7.5 or more than $18.25\n") HourlyRate = float(raw_input("Please input the hourly wage of the employee: \n")) while 7.5 > HourlyRate: print("Error: Employees cannot make less than $7.5 or more than $18.25\n") HourlyRate = float(raw_input("Please input the hourly wage of the employee: \n")) HoursWorked = float(raw_input("Please input the amount of hours worked averaged per week: \n")) while 40 < HoursWorked: print("Error: Employees cannot work less than 1 hour or more than 40 hours\n") HoursWorked = float(raw_input("Please input the amount of hours worked averaged per week: \n")) while 1 > HoursWorked: print("Error: Employees cannot work less than 1 hour or more than 40 hours\n") HoursWorked = float(raw_input("Please input the amount of hours worked averaged per week: \n")) WeeklyPay = HourlyRate * HoursWorked GrossPay = HourlyRate * HoursWorked * 52 print("Your weekly earnings are ${:.2f}".format(WeeklyPay)) print("Your gross earnings are ${:.2f}".format(GrossPay))
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