Lowest price ever! Learn Generative AI for 48% less!
Get my discount0
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
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
+ 1
total_friend.sort()
print(total_friend[0])
or
print(sorted(total_friend)[0])