0
Can anyone explain below problem?
x = 'a' if (x < 'c'): x += 'b' if (x > 'z'): x += 'c' print (x) Ans is ab.
4 Answers
0
#first if statement
'a'<'c'==True
So x= 'a'+'b'='ab'
#second if statement
'a'>'z'==False
#final output
x='ab'
+ 3
the ascii value of a=97, c=99, z=122
x='a'
# first if statement
'a'<'c'==True
x+='b'
x=x+'b'
x=ab
so answer is ab
0
ans is ab
0
ŠŠ¾ŃŠµŠ¼Ń āŠ°ā Š¼ŠµŠ½ŃŃŠµ āŃā?