Question: Suppose I have the following code. What is the output of the print statement given what is in the file's location below and the user
Suppose I have the following code. What is the output of the print statement given what is in the file's location below and the user enters and for the input statements? fileC:UsersITEmyDatatx
readyToEndFalse
while not readyToEnd:
firstNuminputFirst number:
if firstNumq:
readyToEndTrue
if not readyToEnd:
secondNuminputSecond number:
if secondNumq:
readyToEndTrue
if not readyToEnd:
try:
filenamePathfile
contentsfilename.readtext
linescontents.splitlines
#printresults
answerintfirstNumintsecondNum
except ZeroDivisionError:
printError dividing by
except FileNotFoundError: printCouldnt find file"
else:
printSuccess
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
