Why output is r ?
Check this out for reference: https://code.sololearn.com/cGh63mKrL4iT/?ref=app
If you see the ASCII values of all the letters in SoloLearn then you will see that the 'r' comes the last: You can remember ascii in this way: 65-90 -> capital letters (A,B,C,D......) 97-122 -> lowercase letters (a,b,c,d.....) 49-58 -> numbers (1,2,3,4......) So if it was 'sololearn' then the highest value would be 's'
Gaurav Dixit 🇮🇳 I know that, I just gave him an example that if 's' was in lowercase then the answer would have been 's' instead of 'r'
Kuba Siekierzyński 👏👏👏👍👍👍 32 -> ' ' (space) Try this: chr(83) + chr(105) + chr(109) + chr(98) + chr(97) output: Simba In order to find out tge ascii value of any letter: print(ord('S')) output: 83
Simba it's take max of ASCII code
Gaurav Dixit 🇮🇳 you're correct. But it's working now✌
Namit Jain In question S is capital bro read question carefully
It is taking ascii value of every character. Ascii value 'S' and 'L' in SoloLearn are 83 nd 76. All other characters in small letter are having more ascii value than S nd L. Among 'oloearn' ascii value of "r" is max.
The Ascii value of small letters is greater than that of capital letters So the Ascii vaue of r is greater than S Hence the max returns the value r as output
The answer is r and the reason is because the position python is in using the max () function returns the largest element in an iterable. But it can also be used to find the largest element between two or more parameters and that is why in the word "SoloLearn" by searching in it using the max () function find the character that has the assignment in ascii is "r" when comparing among others. r has the highest value S = 83 o = 111 l = 108 o = 111 L = 76 e = 101 a = 97 r = 114 n = 110
Ascii for Capital letters start from 65 And for small letters it starts from 97
I am not able to understand answer is "S" or "r"
Simba also your app is not working
somya darshi patra 's' is in capital letter see carefully ('S')
In this question ascii value of r is higher thats way the answer will be (r).🤗
I anyone satisfied with my reason then give me up vote
Why won't my image display
I have made a calculator in which my % (Percentage) not work correctly for 100%50 or 100%20.
How the answer is 50?
Number of Ones ( C++ ) question!