-1

if Sugar == "Yes" or "yes" or "ja" or "Ja": print(Msg1)

How can I make this shorter instead of using a dozen of or's

Celyse
  • 1
  • 1

1 Answers1

0

You could do:

if Sugar in ["Yes", "yes", "ja", "Ja"]:
    print(Msg1)
bglbrt
  • 2,018
  • 8
  • 21