-
-
Save foxx/428f167427f4e556e467bc8ff13c18f9 to your computer and use it in GitHub Desktop.
python
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python3 | |
hrs = input("Enter Hours:") | |
rate = input("Enter Rate:") | |
#Computing Overtime | |
if float(hrs) > 40: | |
hrs_difference = float(hrs) - 40 | |
#print(hrs_difference) | |
overtime_pay = float(hrs_difference *(rate * 1.5)) | |
print(overtime_pay) | |
#total = str((float(hrs) * float(rate) + overtime_pay)) | |
#print('Pay: ' , total) | |
else: | |
total = str(float(hrs) * float(rate)) | |
print("Pay: " ,total) | |
Error Message | |
File "./total_hours.py", line 9, in <module> | |
overtime_pay = float(hrs_difference *(rate * 1.5)) | |
TypeError: can't multiply sequence by non-int of type 'float' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment