0

Python related problem

Why is Apeksha shown as minimum when anvita should be minimum. Is it because anvita's "a" is small and do min and max is found out like a dictionary? thanx in advance. https://code.sololearn.com/cHvbxql3wP1a/?ref=app

20th Oct 2020, 5:50 PM
<k>Kartik</k>
2 Answers
+ 4
a has acsii value of 90 and A has a ASCII value of 65 ,strings are compared characters by characters ,so A of Apeksha is smaller than a is smaller than a of anvita's ,also if the first character had similar value like A in Apkesha and Anvita's than p and n ASCII value would have been compared
20th Oct 2020, 5:59 PM
Abhay
Abhay - avatar
+ 1
total_friend.sort() print(total_friend[0]) or print(sorted(total_friend)[0])
20th Oct 2020, 6:10 PM
Shadoff
Shadoff - avatar