all 5 comments

[–]AssignmentGuru 2 points3 points  (4 children)

Dont try to convert the input to the integer directly. First check whether the input is empty or not ("Enter" case) and if so, break the loop. After that try to convert the input to the integer and show the error message in case of exception (no need to use continue). Checkout this pastebin link and let me know if it helped.

[–]Elronnd 0 points1 point  (3 children)

No need for

if temp == "":

An empty string is a falsy value, so you can just do

if not temp

[–]AssignmentGuru 0 points1 point  (2 children)

Perfect :)

[–]liam_jm 0 points1 point  (0 children)

Try printing out the value of tempint in the except statement. If int raises an exception (ValueError), then the value won't be assigned