x = input("Enter state 1")
y = input("Enter state 2")
z = input("Enter state 3")
# The three states are strings among a list
For example:
state_1 = ['Light', 'Medium', 'Heavy']
state_2 = ['Small', 'Medium', 'Large']
state_3 = ['Blue', 'Red', 'Black']
If x != 'Light' or 'Medium' or 'Heavy':
print("Wrong input")
else:
x = pre_defined_function(x) #let's say
# Same to be done with other states, output given only if all three states are entered correctly
I have tried doing try and except, but couldn't get it:
Please help me in identifying the correct method for this validation