2017-01-27 1 views
-3

So stellte ich neues Problem, vielleicht könnte jemand helfen? Wenn ich Nation zu M ändere, funktioniert es nicht mehr. Es sollte "Danke" drucken, wenn die Nation m oder M. istPython etwas falsch mit "oder"

nation = "m" 
type = 1 
if nation == ("m" or "M") and type == 1: 
    print("Thanks") 
+1

'wenn nation.lower() == 'm' und Typ == 1:' –

Antwort

0
nation = "m" 
type = 1 
if (nation == "m" or nation == "M") and type == 1: 
    print("Thanks") 
Verwandte Themen