Question: use python, no built in functions Leading zeros are used to prevent fraud by filling in character positions that might normally be empty. For example,
use python, no built in functions
Leading zeros are used to prevent fraud by filling in character positions that might normally be empty. For example, adding leading zeros to the amount of a check (or similar financial document) makes it more difficult for fraudsters to alter the amount of the check before presenting it for payment. Assuming you have the following list hours_worked - The first number is the hours worked, the second is their hourly rate.
hrs1 = John,10,20
hrs2 = Jane,10,25
hrs3 = Jess,12,10
hrs4 = James,8,10
hours_worked = [hrs1,hrs2,hrs3,hrs4]
1. Write a function print_salary that takes one element of the list and prints the desired output: for example: for the first element hrs1, the output is John worked 10 hours at a $20 hourly rate. The total salary is 00200. (Use print with format strings to output this line) Use zfill on strings to pad the leading zeros
Write a main function to call the print_salary function appropriately
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
