Answered step by step
Verified Expert Solution
Question
1 Approved Answer
What will be the output after the following code is executed and the user enters 7.55 at the first prompt def main(): try: hours -
What will be the output after the following code is executed and the user enters 7.55 at the first prompt def main(): try: hours - int(input("Enter total hours worked? ")) hourly_rate = float (input ("Enter rate per hour (QAR) ") ) payment = hours "hourly_rate f - open( 'Tax-txt', 'r') tax_rate - float (f, read ()) tax_amount = tax_rate*payment print(tax_amount) except FileNotFoundError: print('ERROR: file not found') except ValueError: print ('ERROR: total hours worked must be integer') main() BRROR: file not found RRROR: total hours worked must be integer ERROR: file not found RRROR: total hours worked must be integer Tax_amount will be displayed, based on the tx,rate in the Tax,txt file
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started