a = input(“Enter your value between 6 and 9 or value should be quit:”)
if a==”quit” or int(a)>6 and int(a)<9:
print(a)
else:
raise ValueError(“Your entered value is invalid”
I could write only this. But in my program if I enter any integer which doesn’t lie between 6 & 9 it still raises error? How to fix that? i.e. if a = 100,we get Custom Error which I don’t want.
submitted by /u/FewNectarine623
[link] [comments]
r/learnpython a = input(“Enter your value between 6 and 9 or value should be quit:”) if a==”quit” or int(a)>6 and int(a)<9: print(a) else: raise ValueError(“Your entered value is invalid” I could write only this. But in my program if I enter any integer which doesn’t lie between 6 & 9 it still raises error? How to fix that? i.e. if a = 100,we get Custom Error which I don’t want. submitted by /u/FewNectarine623 [link] [comments]
a = input(“Enter your value between 6 and 9 or value should be quit:”)
if a==”quit” or int(a)>6 and int(a)<9:
print(a)
else:
raise ValueError(“Your entered value is invalid”
I could write only this. But in my program if I enter any integer which doesn’t lie between 6 & 9 it still raises error? How to fix that? i.e. if a = 100,we get Custom Error which I don’t want.
submitted by /u/FewNectarine623
[link] [comments]