17.1k views
16 votes
Create a Python program to solve a simple pay calculation.

1 Answer

10 votes

Answer:

def weeklyPaid(hours_worked, wage):

if hours_worked > 40:

return 40 * wage + (hours_worked - 40) * wage * 1.5

else:

return hours_worked * wage

hours_worked = 50

wage = 100

pay = weeklyPaid(hours_worked, wage)

print(f"Total gross pay: Rs.{pay:.2f} ")

Step-by-step explanation:

provides gross pay

User MelkorNemesis
by
5.1k points