If　`a = 1, b = 2, c = 3 ... z = 26`

Then `l + o + v + e = 54`

and `f + r + i + e + n + d + s + h + i + p = 108`

So `friendship` is twice stronger than `love` :-)

The input will always be in lowercase and never be empty.

Difficulty: introductory

Starter code:

def words_to_marks(s):
	

Solutions:
def words_to_marks(s):
  return sum(ord(c)-96 for c in s)

def words_to_marks(s):
    return sum('_abcdefghijklmnopqrstuvwxyz'.index(e) for e in s)

def words_to_marks(s):
    return sum( ord(i)-(ord('a')-1) for i in s )

def words_to_marks(s):
    return sum(map(ord,s))-len(s)*96

def words_to_marks(s):
    base = ord('a') - 1
    return sum(ord(l) - base for l in s)


def words_to_marks(s):
    l = []
    d = {'a': 1, 'b': 2, 'c': 3, 'd' : 4, 'e' : 5, 'f' : 6, 'g' : 7, 'h' : 8,
        'i' : 9, 'j' : 10, 'k' : 11, 'l' : 12, 'm' : 13, 'n' : 14, 'o' : 15, 'p' : 16,
        'q' : 17, 'r' : 18, 's' : 19, 't' : 20, 'u' : 21, 'v' : 22, 'w' : 23,
        'x' : 24, 'y' : 25, 'z' : 26}
    for char in list(s):
        l.append(d[char])
    return(sum(l))
        


words_to_marks = lambda s: sum(ord(e)-96 for e in s)

def words_to_marks(s):
  return sum( ord(c)-96 for c in s )

WordsToMarks = words_to_marks

def words_to_marks(s):
    alphabet = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z']   
    my_list = list(s)
    summ = 0
    for x in range(len(my_list)):
        for y in range(len(alphabet)):
            if my_list[x] == alphabet[y]:
                summ += (y + 1)
    return summ

def words_to_marks(s):
    lett = [chr(i) for i in range(ord('a'),ord('z')+1)]
    nums = [i for i in range(1, 27)]
    z = zip(lett, nums)
    d = dict(z)
    s1 = [d[i] for i in s]
    return sum(s1)

def words_to_marks(word):
    return sum(ord(ch) - 96 for ch in word)

def words_to_marks(letters):
    result = 0
    for letter in letters:
        result += ord(letter) - 96 # 1 - ord('a') = 96
    return result

def words_to_marks(word):
    return sum(ord(char) - 96 for char in word)


def words_to_marks(s):
    return sum([ord(char) - 96 for char in s])


import string
def words_to_marks(s):
  return sum(string.ascii_lowercase.index(x) + 1 for x in s)

words_to_marks=lambda s:sum(ord(x)-96for x in s)

def words_to_marks(s):
    return sum([int(ord(k))-96 for k in s])

def words_to_marks(s):
    return sum(ord(c) for c in s) - 96*len(s)

def words_to_marks(s):
    return sum(ord(x) for x in s) - 96 * len(s)

def words_to_marks(s):
    return sum(ord(i)-96 for i in s)

def words_to_marks(s):
    q2 = 0
    for i in s:
        if i == 'a':
            q2 += 1
        elif i == 'b':
            q2 += 2
        elif i == 'c':
            q2 += 3
        elif i == 'd':
            q2 += 4
        elif i == 'e':
            q2 += 5
        elif i == 'f':
            q2 += 6
        elif i == 'g':
            q2 += 7
        elif i == 'h':
            q2 += 8
        elif i == 'i':
            q2 += 9
        elif i == 'j':
            q2 += 10
        elif i == 'k':
            q2 += 11
        elif i == 'l':
            q2 += 12
        elif i == 'm':
            q2 += 13
        elif i == 'n':
            q2 += 14
        elif i == 'o':
            q2 += 15
        elif i == 'p':
            q2 += 16
        elif i == 'q':
            q2 += 17
        elif i == 'r':
            q2 += 18
        elif i == 's':
            q2 += 19
        elif i == 't':
            q2 += 20
        elif i == 'u':
            q2 += 21
        elif i == 'v':
            q2 += 22
        elif i == 'w':
            q2 += 23
        elif i == 'x':
            q2 += 24
        elif i == 'y':
            q2 += 25
        elif i == 'z':
            q2 += 26
    return q2

# go next, ggwp
# go next, ggwp
# go next, ggwp
def words_to_marks(s):
    listen = {'a': 1, 'b': 2, 'c': 3, 'd': 4,
                'e': 5, 'f': 6, 'g': 7,
                  'h': 8, 'i': 9, 'j': 10, 
                    'k': 11, 'l': 12, 'm': 13,
                       'n': 14, 'o': 15, 'p': 16,
                         'q': 17, 'r': 18, 's': 19,
                            't': 20, 'u': 21, 'v': 22, 
                               'w': 23, 'x': 24, 'y': 25, 
                                  'z': 26}
    x = s
    dd = []
    for i in x:
        if i in listen.keys():
            dd.append(listen[i])
    x = sum(dd)
    return (x)

from string import ascii_lowercase

def words_to_marks(s):
    return sum(ascii_lowercase.index(i) + 1 for i in s)

import string
def words_to_marks(s):
    sum = 0
    for a in s:
      sum = sum + list(string.ascii_lowercase).index(a)+1
    return sum

import string
def words_to_marks(s):
    result = 0;
    alpha = list(string.ascii_lowercase)
    
    word = (",".join(s)).split(",")
    for i in word:
        result += alpha.index(i) + 1
    return result


def words_to_marks(s):
    
    a = "abcdefghijklmnopqrstuvwxyz"
    j = 0
    for i in s:
        j = j + (int(a.index(i)) + 1)
        
    return j
    
    


def words_to_marks(s):
    ergebniss = 0
    for x in s:
        ergebniss += ord(x) - 96
    return ergebniss

def words_to_marks(s):
    letters = map(chr, range(97, 123))
    integers = range(1, 27)
    definition = dict(zip(letters, integers))
    result = 0
    for i in s:
        result += definition.get(i, 0)
    return result

def words_to_marks(s):
    r = 0;
    lis = ["a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z"]
    for x in s:
      r+=lis.index(x)+1;
    return r;


def words_to_marks(s):
    alpha='0abcdefghijklmnopqrstuvwxyz'
    return sum(alpha.find(char) for char in s)

def words_to_marks(s):
    alpha = ['a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z']
    total = 0
    for i in range(0, len(s)):
        total = total + 1 + alpha.index(s[i])
    return total


def words_to_marks(s):
    summ = 0
    for x in s:
        for z, y in enumerate('abcdefghijklmnopqrstuvwxyz', 1):
            if y == x:
                summ += z
    return summ

def words_to_marks(s):
    from string import ascii_lowercase
    answer = 0    
    for element in s:
        answer += ascii_lowercase.index(element) + 1
    return answer    

def words_to_marks(s):
    return sum(ord(x) - 96 for x in s)

def words_to_marks(s):
    abc = " abcdefghijklmnopqrstuvwxyz"
    return sum([abc.index(let) for let in s])    


def words_to_marks(s):
    abc = " abcdefghijklmnopqrstuvwxyz"
    return sum([abc.index(letter) for letter in s])

        
        


def words_to_marks(s):
    abc = " abcdefghijklmnopqrstuvwxyz"
    return sum([abc.index(l) for l in s])


def words_to_marks(word):
    abc = " abcdefghijklmnopqrstuvwxyz"
    return sum([abc.index(el) for el in word])

def words_to_marks(s):
    arr = ["a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z"]
    return sum([arr.index(ch) + 1 for ch in s])

def words_to_marks(s):
    abc = dict(zip('abcdefghijklmnopqrstuvwxyz', range(1, 27)))
    
    sum = 0;
    
    for char in s:
        sum += abc[char]
    
    return sum

import string
def words_to_marks(s):
    return sum([string.ascii_lowercase.find(x)+1 for x in s])

def words_to_marks(s):
    abc = "abcdefghijklmnopqrstuvwxyz"
    result = 0
    for letter in s:
        result+=abc.index(letter)+1
    
    return result

def words_to_marks(s):
    return sum(ord(n)-96 for n in s)

import string

def words_to_marks(input_str):
    
    # Build dictionary of letters and corresponding numbers    
    values = dict(list(zip(string.ascii_lowercase, list(range(1,27)))))
    
    # Convert input string to list
    input_lst = list(input_str)
    
    # Get total value for input
    value = 0
    for elem in input_lst:
        value += values[elem]
        
    return value


def words_to_marks(s):
    import string
    a=string.ascii_lowercase[::]
    b=list(range(1, len(a)+1))
    dictionary = {}
    i = 0
    
    for x in a:
        dictionary[x] = b[i]
        i +=1
    
    new_list=[]

    for x in s:
        new_list.append(dictionary.get(x))

    return sum(new_list)

def words_to_marks(string):
    return sum(ord(char)-96 for char in string)

import string
def words_to_marks(s):
    # Easy one
    letters = string.ascii_lowercase
    total = 0
    
    for i in s:
        total += letters.index(i) + 1

    return total
    


def words_to_marks(s):
  s = s.lower()
  sum_char = 0
  characters ={'a':1, 'b':2, 'c':3, 'd':4,'e':5, 'f':6, 'g':7,'h':8,'i':9, 'j':10, 'k':11, 'l':12,'m':13,'n':14,'o':15,'p':16,'q':17, 'r':18,'s':19,'t':20,'u':21, 'v':22,'w':23,'x':24,'y':25,'z':26}
  for char in s:
    number = characters[char]
    sum_char+=number
  return sum_char

def words_to_marks(s):
    # using enumerate() ;)
    sum = 0 
    d = { alpha:i for i,alpha in enumerate('abcdefghijklmnopqrstuvwxyz', start = 1) } # key-val pairs of all alphabets
    for letter in s:
        sum += d[letter]
    return sum


def words_to_marks(s):
  s = s.lower()
  sum_char = 0
  characters =['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z']
  for char in s:
    if char in characters:
      number = characters.index(char) + 1
      sum_char+=number
  return sum_char

import string
def words_to_marks(s):
    # Easy one
    letter_dict = {}
    letters = list(string.ascii_lowercase)
    for i in range(0, 26):
        letter_dict[letters[i]] = i+1
    sum = 0
    for letter in s:
        sum += letter_dict[letter]
    return sum

def words_to_marks(s):
    alphabet = ['a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z']
    marks = 0
    
    for letter in s:
        marks += alphabet.index(letter) + 1
    
    return marks

def words_to_marks(s):
    letters = list(s)
    word_value = 0
    sum_list = []
    dicti = {}
    alphabet = list('abcdefghijklmnopqrstuvwxyz')
    for i in range(len(alphabet)):
        dict_ = {alphabet[i]: i}
        dicti.update(dict_)
    for j in letters:
        word_value += dicti[j] + 1
    return word_value

            


def words_to_marks(s):
    words_value = 0
    alphabet = 'abcdefghijklmnopqrstuvwxyz'
    alphabet = list(alphabet)
    word = list(s)
    letters_value = {}
    for i in range(len(alphabet)):
        dict_ = {alphabet[i]: i}
        letters_value.update(dict_)
    for j in word:
        words_value = words_value + letters_value[j] + 1
    print(words_value)
    return words_value
s = 'cat'
words_to_marks(s)

import string
def words_to_marks(s):
    alpha={}
    j=1
    for i in string.ascii_lowercase:
        alpha[i]=j
        j=j+1
    j=0
    for a in s:
        j=j+alpha[a]
    return j

import string
values = dict()
for index, letter in enumerate(string.ascii_lowercase):
    values[letter] = index + 1
def words_to_marks(s):
    total = 0 
    for let in s:
        total += values[let]
    return total


alpha="-abcdefghijklmnopqrstuvwxyz"
def words_to_marks(s):
    return sum ( [alpha.index(x)  for x in s] )

def words_to_marks(s):
    alf = ' abcdefghijklmnopqrstuvwxyz'
    sum_out = 0
    for q in range(len(s)):
        sum_out = sum_out + alf.find(s[q])
    return sum_out

def words_to_marks(s):
    sum=0
    for i in s:
        a=ord(i)
        a=a-96
        sum=sum+a
    return sum

def words_to_marks(s):
    dict = {
    "a": 1, "b": 2, "c": 3, "d": 4, "e": 5, "f": 6, "g": 7, "h": 8,
    "i": 9, "j": 10, "k": 11, "l": 12, "m": 13, "n": 14, "o": 15,
    "p": 16, "q": 17, "r": 18, "s": 19, "t": 20, "u": 21, "v": 22,
    "w": 23, "x": 24, "y": 25, "z": 26
    }
    value = 0
    for i in s:
        value += dict.get(i)
    return value

def words_to_marks(s):
    total = 0
    for ltr in s:
        total += (ord(ltr)-96)
    return total


def words_to_marks(s):
    alpha = ' abcdefghijklmnopqrstuvwxyz'
    return sum([alpha.index(c) for c in s])

def words_to_marks(s):
    # Easy one
    import string
    letters = string.ascii_lowercase
    score = 0
    for letter in s:
        score += letters.index(letter) + 1
    return score


def words_to_marks(s):
    alphabet = ["!",'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z']
    result = []
    for c in s:
        result.append(alphabet.index(c))
    return sum(result)


def words_to_marks(s):
    sum = 0
    for ch in s:
        sum+=(ord(ch)-96)
    #end for
    return sum


def words_to_marks(s):
    a = [ord(char)- 96 for char in s]
    return sum(a)
    


def words_to_marks(s):
    return sum([ord(i)-96 for i in s.lower()]) 


from functools import reduce 

def words_to_marks(s):
    
    return reduce((lambda x,y: x+y), map((lambda x: ord(x) - 96), list(s)))

def words_to_marks(s):
    alphabet = "abcdefghijklmnopqrstuvwxyz"
    res = 0
    for i in s:
        res += alphabet.index(i) + 1
    return res

def words_to_marks(s):
    score = 0
    alpha = "abcdefghijklmnopqrstuvwxyz"
    for char in s:
        index = (alpha.find(char)) + 1
        score += index
    return score

def words_to_marks(s):
    translate = {"a":1, "b": 2, "c": 3, "d": 4, "e":5, "f":6, "g": 7, "h": 8, "i":9, "j": 10, "k": 11, "l": 12, "m": 13, "n": 14, "o": 15, "p": 16, "q": 17, "r":18, "s": 19, "t": 20, "u": 21, "v":22, "w": 23, "x":24, "y":25, "z": 26}
    nlst = []
    for letter in list(s):
        nlst.append(translate[letter])
        
    return sum(nlst)


def words_to_marks(s):
    points = {
            "a": 1, "b": 2, "c": 3, "d": 4, "e": 5, "f": 6, 
            "g": 7, "h": 8, "i": 9, "j": 10, "k": 11, "l": 12, 
            "m": 13, "n": 14, "o": 15, "p": 16, "q": 17, "r": 18, 
            "s": 19, "t": 20, "u": 21, "v": 22, "w": 23, "x": 24, 
            "y": 25, "z": 26
            }
    total = 0
    for n, letter in enumerate(s):
        total += points[letter]
    return total

import string

def words_to_marks(word):
    alphabet = {char: i for i, char in enumerate(string.ascii_lowercase, start=1)}

    values = [alphabet[letter] for letter in word if letter in alphabet]
    return sum(values)

def words_to_marks(s):
    total = 0
    alphabet = ' abcdefghijklmnopqrstuvwxyz'
    for eachletter in s:
        total = total + alphabet.index(eachletter)
    return total

import string
def words_to_marks(phrase):
    sum = 0
    for letter in phrase:
        letter = string.ascii_lowercase.index(letter) + 1
        sum += letter

    return sum

def words_to_marks(word):
    s = " abcdefghijklmnopqrstuvwxyz"
    a = 0
    for el in word:
        a = a + s.index(el)
    return a

def words_to_marks(word):
    s = " abcdefghijklmnopqrstuvwxyz"
    a = 0
    for el in word:
        a += s.index(el)
    return a

from string import ascii_lowercase

def words_to_marks(s):
    abc = ' ' + ascii_lowercase
    return sum(abc.index(char) for char in s)

def words_to_marks(s):
    import string
    alpha = string.ascii_lowercase
    dic = {}
    for char in alpha:
        dic[char] = alpha.index(char)+1
    score = 0
    for char in s:
        score += dic[char]
    return score

def words_to_marks(s):
    total = 0
    d = {'a':1, 'b': 2, 'c':3, 'd':4, 'e':5,
        'f':6, 'g':7, 'h':8, 'i':9, 'j':10, 'k':11, 'l':12,
         'm':13, 'n':14, 'o':15, 'p':16, 'q':17, 'r':18,
         's':19, 't':20, 'u':21, 'v':22, 'w':23, 'x':24, 'y':25, 'z':26}
    for i in s:
        total += d[i]
    return total

import string

def words_to_marks(s):
    return sum(map(string.ascii_lowercase.index, s)) + len(s)


def words_to_marks(s):
    l='abcdefghijklmnopqrstuvwxyz'
    res=0
    for i in s:
        res+=l.index(i)+1
    return res

def words_to_marks(s):
    alphabet = {
        'a': 1,
        'b': 2,
        'c': 3,
        'd': 4,
        'e': 5,
        'f': 6,
        'g': 7,
        'h': 8,
        'i': 9,
        'j': 10,
        'k': 11,
        'l': 12,
        'm': 13,
        'n': 14,
        'o': 15,
        'p': 16,
        'q': 17,
        'r': 18,
        's': 19,
        't': 20,
        'u': 21,
        'v': 22,
        'w': 23,
        'x': 24,
        'y': 25,
        'z': 26,
    }
    
    sum_length = 0
    for char in s:
        sum_length += alphabet[char]
    
    return sum_length

def words_to_marks(s):
    import string
    dic = dict(zip(string.ascii_lowercase, range(1,27)))
    res = 0
    for letter in s:
        res += dic.get(letter,0)
        # dict.get(key, defaultvalue)
    return res

def words_to_marks(s):
    r = " abcdefghijklmnopqrstuvwxyz"
    return sum([r.index(el) for el in s if el])



def words_to_marks(s):
    r = " abcdefghijklmnopqrstuvwxyz"
    return sum([r.index(el) for el in s ])


def words_to_marks(s):
    r = " abcdefghijklmnopqrstuvwxyz"
    return sum([r.index(el) for el in s ])

def words_to_marks(s):
    num=0
    for character in s:
        num=num+ord(character) - 96
    return num

def words_to_marks(s):
    dict = {'a': 1, 'b': 2, 'c': 3, 'd': 4,'e': 5, 'f': 6, 'g': 7, 'h': 8, 'i': 9,
            'j': 10, 'k': 11, 'l': 12, 'm': 13, 'n': 14, 'o': 15, 'p': 16, 'q': 17, 'r': 18, 
            's': 19, 't': 20, 'u': 21, 'v': 22, 'w': 23, 'x': 24, 'y': 25, 'z': 26}    
    sum = 0
    for i in s:
        sum += dict[i]
        
    return sum    

import string
def words_to_marks(s):
    result = []
    counter = dict(zip(string.ascii_lowercase, range(1,27)))
    for i in s:
        if i in counter.keys():
            result.append(counter.get(i))
    return sum(result)

import string
def words_to_marks(s):
    alphabet = string.ascii_lowercase
    return sum([alphabet.index(letter) + 1 for letter in s])

import string

def words_to_marks(s):
    alphabet = ' ' + string.ascii_lowercase
    return sum([alphabet.index(letter) for letter in s])

import string

def words_to_marks(s):
    alphabet = ' ' + string.ascii_lowercase
    s1 = 0
    for letter in s:
        s1 += alphabet.index(letter)
        
    return s1


def words_to_marks(s):
    i=0
    for ch in s:
        i = i + ord(ch) - 96
    return i

def words_to_marks(s):
    sum = 0
    for letters in s:
        sum += ord(letters)-96
    return sum