Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
while loop
#2
Such a situation is called 'validation'. There are several threads in this forum where this subject is well explained.

Short explainer: for these situations one can take advantage of EAFPL (Easier to ask for forgiveness than permission). You try to do something and only if error happens you deal with it.

If you try to convert into int something which is not base 10 Python throws ValueError. You just handle this situation.
I'm not 'in'-sane. Indeed, I am so far 'out' of sane that you appear a tiny blip on the distant coast of sanity. Bucky Katt, Get Fuzzy

Da Bishop: There's a dead bishop on the landing. I don't know who keeps bringing them in here. ....but society is to blame.
Reply


Messages In This Thread
while loop - by Blob - Nov-12-2019, 11:03 AM
RE: while loop - by perfringo - Nov-12-2019, 11:25 AM
RE: while loop - by jefsummers - Nov-12-2019, 12:21 PM
RE: while loop - by ichabod801 - Nov-12-2019, 12:46 PM
RE: while loop - by Blob - Nov-14-2019, 04:09 PM
RE: while loop - by ichabod801 - Nov-14-2019, 04:45 PM
RE: while loop - by Renym - Nov-15-2019, 01:50 PM
RE: while loop - by jefsummers - Nov-15-2019, 01:59 PM
RE: while loop - by ichabod801 - Nov-15-2019, 02:03 PM
RE: while loop - by the_ophidian_order - Nov-15-2019, 03:42 PM

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020