python – Calculate salary from time worked

Design a program to calculate the salaries of a company’s employees based on the following data:

  • Number of hours worked.
  • The work shift performed: Morning (m), Afternoon (t), Night (n).
  • The ordinary hourly rate for each of the workers ($ 37.0).

For the calculation of the gross salary, take into account that the afternoon shift is paid at $1.20 more than the ordinary rate, the evening shift is paid at $1.20 more than the ordinary rate, and the night shift is paid at $1.50 more than the ordinary rate.

For the calculation of the net salary, certain discounts are made only to those on the night shift according to the following table:

gross salary discount
From 2000 to 5000 15%
From 8000 to 10000 17%

You want to print the net salary of each worker.

ht = int(input('Number of hours worked: ')) 
tt = str(input('nm. Morningnt. Afternoonnn. NightnnOption:: '))

if tt == 'm':
    r = (0)
elif tt == 'a':
    r = float(1.2*ht)
elif tt == 'n':
    r = float(1.5*ht)

s1 = float(ht*37)
sb = float(s1+r)

if r == 0:
    sn = float(sb)
elif r == (1.2*ht):
    sn = float(sb)
elif r == (1.5*ht):
    if sb >= 2000 and sb <= 5000:
        sn = float(sb*0.15)
    elif sb >= 8000 and sb <=10000:
        sn = float(sb*0.17)
    else:
        sn = float(sb)

print('Net salary:',sn)