Nov-12-2019, 11:25 AM
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.
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.
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.