쌉소리 일지

26일 새벽 3시에 카톡에서 작성한 python 코드

쟉트 2024. 3. 28. 13:33
728x90
#quiz 2

employee_name = input("Enter employee name: ")
hourly_wage = input("Enter the hourly rate ($) : ")
hourly_wage = float(hourly_wage)
worked_hours = input("Enter the number of hours worked in the past week (h) : ")
worked_hours = float(worked_hours)
if worked_hours > 168 :
	print("Out of range")
elif worked_hours < 0 :
	print("Out of range")
elif worked_hours > 40 :
	overtime = worked_hours - 40
    total_wage = 40 * hourly_wage + overtime*1.5*hourly_wage
else :
	total_wage = hourly_wage*worked_hours

print("Employee : "+employee_name)
print("The pay will be $"+ str(total_wage)+"for "+str(worked_hours)+" hours of work"

 

친구를 위해...