DECROMAX

Hourly paid challenge

Nov 12th, 2021
346
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.46 KB | None | 0 0
  1. hours_per_week = [22, 17, 27, 40, 45]
  2. weeks = [48, 50, 42, 46, 43]
  3. hourly_pay = ['John,1', 'Eric,1.5', 'Terry,2', 'Michael,4', 'Graham,2']
  4.  
  5. total_hrs = [i * x for i, x in zip(hours_per_week, weeks)]
  6. hourly_pay_rate = [float(i.split(',')[1]) for i in hourly_pay]
  7. hourly_pay_name = [i.split(',')[0] for i in hourly_pay]
  8.  
  9. for hours, rate, name in zip(total_hrs, hourly_pay_rate, hourly_pay_name):
  10.     print(f'{name} made {int(hours * rate):,} in {hours:,} hours')
  11.  
Advertisement
Add Comment
Please, Sign In to add comment