color = input("Choose color between white and blue: ") size = input("Choose size: ") available = False while not available: if color == "white": if size == "M" or size == "L": print("available") available = True else: print("unavailable") break elif color == "blue": if size == "M" or size == "S": print("available") available = True else: print("unavailable") break else: print("Please choose the correct color!") breakI don't understand why Python tags don't work now.
Anyway, I have several questions regarding the code now.
1. this part
available = False while not available:"while not available" in this case means True since we have "available = False", right? I still don't understand why we need this in exactly this way? Can we do the opposite? Set available to True...
2. When adding some third color I first receive Choose size input. Is there any way to avoid this? To get "Please choose the correct color!" immediately if I, for example, type in green colour?