0
More than one value for a same "if" line?
Can i have more than one value assigned for a variable in a same if line? How can I do that? Example: name = str(input('Who are you?' )) if name == ('Joe', 'Jack', 'Josh') print('Welcome,', name,'!') else: print('Get lost!') >> Except that the comas do not work as separators. Can anyone give me a hint?
1 Antwort
+ 1
Look into the keyword “in” and compare its functionality to the “==“ operator :)
Also, dont forget to add a colon to the end of your if statement