Question: (20p) 2. Create a Python program that takes an integer as user input and tries to convert it to the int type. If the user
(20p) 2. Create a Python program that takes an integer as user input and tries to convert it to the int type. If the user input is not an integer, the exception raised should be handled with the message Error: You did not enter an integer. If the user input is a valid integer, the program should check if it is larger than zero, and print the square of the entered number if it is. If the user input is not larger than zero, the program should print Sorry, I only work with positive integers. At the very end of the program, the message -- End of Program -- should be printed to the console.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
