I want to check a group of input, and if any one of them is illegal, I throw a error and make a warning, so I want to make the warning more customed to figure out which one is wrong.
try:
assert input1<1 something like this, "input1 error xxx"
assert input2 xxx, "input2 error xxx"
xxxx
except AssertionError:
make a warning dialog using the assert infomation
except:
pass
else:
pass
Is it possible? I think I can avoid multiple try-except blocks or if blocks, is there a pythonic way to do it? Thank you in advance.
Get it. Thank you for your help. Assert should not use for test. I will modify my code now.