0

Can anyone explain below problem?

x = 'a' if (x < 'c'): x += 'b' if (x > 'z'): x += 'c' print (x) Ans is ab.

25th Feb 2022, 5:27 PM
Yash Pandya
4 Respuestas
0
#first if statement 'a'<'c'==True So x= 'a'+'b'='ab' #second if statement 'a'>'z'==False #final output x='ab'
25th Feb 2022, 7:02 PM
shreya
shreya - avatar
+ 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
9th Dec 2022, 6:40 AM
Pallavi S
0
ans is ab
5th Oct 2022, 2:27 PM
garima
garima - avatar
0
Почему ‘а’ меньше ‘с’?
29th Aug 2023, 4:41 PM
Лилиана Клищенко