How to Indefinitely Request User Input Until Valid in Python

A step-by-step guide to infinite loops and try/except statements

Jonathan Hsu
Better Programming
Published in
3 min readFeb 18, 2020

--

Photo by Sigmund on Unsplash

User input is a tricky thing. I learned very early on that just because you prompt the user’s “email address” or “age”, you’re not going to get a garbled mess of characters.

--

--