I encounter the following exercise. 1. Write a function named readposint that keeps prompting the user for a positive integer, checks the input to confirm that it meets the requirements. It should be able to handle inputs that cannot be converted to int, as well as negative ints, and edge cases (e.g. when the user closes the dialog, or does not enter anything at all.)
So, my question is: how to handle the edge case that when the user closes the dialog? I feel like this exercise is to keep asking the user to input a positive number, and the user simply can not leave the dialog without inputing a correctly positive number. Could anyone help me with this please? Many thanks for your time and attention.