Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def high(x):
- rankList = []
- result = []
- rank = 0
- high = 0
- lst = x.split()
- for word in lst:
- for char in word:
- #print([char, ord(char) -96])
- rank += ord(char)-96
- rankList.append([rank, word])
- rank = 0;
- for i in range(len(rankList)):
- if(rankList[i][0] > high):
- high = rankList[i][0]
- for k in range(len(rankList)):
- if(rankList[k][0] == high):
- result.append([rankList[k][0],rankList[k][1]])
- print(result)
- return result[0][1]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement