Exercises on python | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 5

Exercises on python

Pls, im a beginner in python and i need help with writing the code of the following; in python3 1) Write a program to prompt the user for hours and rate per hour to compute gross pay. ex: Enter Hours: 35 Enter Rate: 2.75 Pay: 96.25 2) Rewrite your pay computation to give the employee 1.5 times the hourly rate for hours worked above 40 hours.

13th Aug 2019, 3:58 PM
elvisreal
elvisreal - avatar
2 Answers
+ 1
#something like this? x=float(input("enter hours\n")) y=float(input("enter rate\n")) if x > 40: y*=1.5 print("overtime") print(x*y) else: print("no overtime") print(x*y)
13th Aug 2019, 4:11 PM
Steven M
Steven M - avatar
+ 4
Thank you n3v375 for your help and time
13th Aug 2019, 4:25 PM
elvisreal
elvisreal - avatar