+ 1

How we get that output..?

sex="F" if(sex=="m"or"M"): print("Male") else: print("Female") O/p:-- Male Can any one explain...

9th Jul 2021, 5:04 PM
Cran
Cran - avatar
1 Respuesta
+ 11
line 2 in code is: if(sex=="m"or"M"): but should be: if(sex=="m"or sex == "M"): or better use a cast: if(sex.upper()=="M"):
9th Jul 2021, 6:17 PM
Lothar
Lothar - avatar