Question: Write code for function main, which gets the user to enter one integer, call it num. Using error handling, if the entry is not a
Write code for function main, which gets the user to enter one integer, call it num. Using error handling, if the entry is not a number, shown an error message. Check the num is a positive number. If it is, use a for loop to create a list where the for loop runs for num number of times. Each time, ask the user for a number (integer), then add it to the end of a list. Once the for loop ends, call the mycheck function from the previous question passing it the List, and test its return value: if not true, display some message, else ask the user for a filename and write the list content to the file. When opening the file to write the data open it in writing mode then close it when done. Call main at the end. Do not add any comments or code not required by this question. This will cause loss of points.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
