Print('z'>'a') #output True. How and why?? Please explain | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Print('z'>'a') #output True. How and why?? Please explain

Print('z'>'a') #output True. How and why?? Please explain

13th Nov 2020, 7:40 AM
Naseem Ullah
Naseem Ullah - avatar
2 Answers
+ 10
ASCII value of a is 97 and z is 122 So 122 > 97. Then 'z' > 'a' returns true
13th Nov 2020, 7:44 AM
ツSampriya😘ツ
ツSampriya😘ツ - avatar
+ 9
Naseem Ullah You need to learn thishttp://sticksandstones.kstrom.com/appen.html 🙂and Me also😅 From this you can understand in a better way how the output comed true, btw all known that z is greater than a that's why the result will comes true.... but in electronical world all alphabets has been given a value that's machines can understand... as aboveツSampriyaツ written in correct manner...
13th Nov 2020, 10:10 AM
ㅤㅤㅤ