Answered step by step
Verified Expert Solution
Question
00
1 Approved Answer
def readAge ( filename ) : strAge = None while True: try: if strAge is : infile = open ( filename ) strAge = infile.readline
def readAgefilename: strAge None while True: try: if strAge is : infile openfilename strAge infile.readline intstrAge printNext year you will be age break except : printValue cannot be converted to integer. strAge inputEnter a proper age: except : printInput file is missing: filename inputEnter a new filename:
def readAgefilename:
strAge None
while True:
try:
if strAge is
:
infile openfilename
strAge infile.readline
intstrAge
printNext year you will be age
break
except
:
printValue cannot be converted to integer.
strAge inputEnter a proper age:
except
:
printInput file is missing:
filename inputEnter a new filename:
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access with AI-Powered 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