I know someone asked about an "unless" that works as if not
, or a not in
, but I'd like to have an statement that introduces an exception to a conditional statement. For example:
if num >= 0 and num <= 99:
# then do sth (except the following line)
unless num = 10:
# in this case do something else
It'd much legible and intuitive than writing:
if (num >= 0 and num <= 9) or (num >= 11 and num <= 99):
# then do sth (except the following line)
elif num = 10:
# in this case do something else
The if not statement doesn't do the same...
NOTE: I'm practically a newbie into this so please bear with me