Question: de la mat , print ancerer 2) Write a program in the Pycharm Editor that does the following: a) Take the user's year of birth

 de la mat , print ancerer 2) Write a program in

de la mat , print ancerer 2) Write a program in the Pycharm Editor that does the following: a) Take the user's year of birth as an input (don't convert it to int yet). b) Check if the input is an integer. If not, print an error message and exit the program c) If it is valid, convert it to int and check that it's a valid year (An integer less than 2021 and greater than 1900). If not, print an error message and exit the program d) Take the user's current age as an input (don't convert it to int yet). e) Check if the input is an integer. If not, print an error message and exit the program. f) If it is valid, convert it to int and check that it's a valid age (An integer less than 120 and greater than 0). g) Calculate the true age by taking 2021 minus the date of birth. h) Check if the age given by the user is equal to the true age. If it's correct, print a message confirming that the age is correct. Otherwise, print an error message and exit the program. Every print function should have a short Python comment explaining the output and use string formatting for the print. If an error is found, DO NOT use sys.exit() to exit the program. Use nested if/else statements to skip over the rest of the program and reach the end

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!