2 f operi (\"C Users WDesk Lop payroll Uxt\", \"r\") Wusert DeskuupWouupuu file
ID: 3849630 • Letter: 2
Question
2 f operi ("C Users WDesk Lop payroll Uxt", "r") Wusert DeskuupWouupuu file C:\Users "open 4 output 6 l for line in f-readlines() columns-line split id-columns[0 name columns[1] column loat (columns 13 10 wage-t days column [4:] 11 totalhours-0 12 13 for hour in days 14 total hours totalhours float 15 16 average Hours tot hours/len (days totalPay-totalhours wage 17 18 19 I result-name ID '+id+' worked sur (totalhours) hourly pay $'+sur (wage) hours: suNaverageHours) '/day Total Pay: sur total pay 20 print (result) 21 L.appernul(resulu+ Vri') utpu out file write output. str ' ') 23 26 outfile close 27Explanation / Answer
You can format your decimal number to any desired decimal places by rounding off the number by using built-in function round( number, decimal_places )
required line of code:-
result = name+' ID '+id+' worked '+str(totalhours)+' hourly pay $'+str(wage)+' hours' + str(round(averageHours,2)) + '/day Total Pay : $' + str(totalPay)
PLEASE RATE !!!
Thank You!!
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.