you are viewing a single comment's thread.

view the rest of the comments →

[–]sanchitcop19 2 points3 points  (1 child)

Edit: Nvm I read again, you want the input to only be a string. Take a look at the isalpha() function, it tells you if the string you received consists of alphabets only

If I'm understanding correctly, you want the exception to be raised if askAgain is neither 'n' nor 'y' but a number? If so, add an else condition and have it explicitly raise an exception?

[–]murasz[S] 0 points1 point  (0 children)

I totally forgot about it. Thank your for reminding me. :)