First read my code, then I’ll explain
It is as easy as only placing a “while True:” loop in order to save the system to break and crash and mutate every living form on Earth into stellar dust from another dimension.
What this loop does is that prevents the code for failing for some sort of input that is not valid, as you can see, I was only asking for an “int”, that’s why I use the function to change the input, but if the user is too dumb and tries to write using letter, everything will be ruined. At first I didn’t think it was going to be too easy, but it was such an easy topic that I was eating some cake at the time I wrote it (cheese cake).
Funfact: You can use the same method for strings, floats, just let your imagination fly and you’ll be able to do amazing things.
good blog, and also a nice cheesecake
LikeLike
Buena explicación, y esta genial que primero pongas el código para poder analizarlo, gracias!
LikeLike
There is a WAAAY more efficient way to do this: https://www.dropbox.com/s/a282p2f3gg6u9dj/test.py?dl=0
Hope it helps 🙂
LikeLiked by 1 person