+ 3

Challenge-- find sum of string value

If a=1, b=2 so on z=26 then take input from user and find sum of string characters ex: input=abcd a+b+c+d=1+2+3+4 output=10

9th Oct 2017, 2:38 AM
manoj Kumar
4 Réponses
+ 15
there might be some correction in example ☺
9th Oct 2017, 2:42 AM
Gaurav Agrawal
Gaurav Agrawal - avatar
+ 10
Shortest code till now - sum=0 for i in input() : if(ord(i.upper()) >=65 and ord(i.upper())<=90): sum+= (ord(i.upper())-64) print(sum) https://code.sololearn.com/cFgFkeDdXZfv/?ref=app
12th Oct 2017, 2:23 PM
Swapnil Srivastava
Swapnil Srivastava - avatar
+ 3
https://code.sololearn.com/cwBOGZ39cos9/?ref=app
9th Oct 2017, 9:59 AM
Emma
9th Oct 2017, 6:11 PM
manoj Kumar