+ 2
I am not getting correct output..😪 Can anyone help me ??... Check my code....
5 Antworten
+ 5
if s[0] in "Aa":
# pass
else:
# fail
+ 4
if s[0] in "Aa":
# or
if s[0] == 'a' or s[0] == 'A':
+ 3
https://docs.python.org/3/reference/expressions.html#operator-precedence
In your code, the precedence of '==' is higher than 'or'.
if s[0] == 'a' or 'A'
equals
if (s[0] == 'a') or ('A')
+ 2
Ipang
Thanks.....😀
+ 2
SoloProg
Thanks...🙂