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: EASY
Tags: Fundamentals

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):
	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
	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) - 96 for 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(x) for x in s)) - 96 * len(s)


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


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):
	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):
	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):
	abc = dict(zip('abcdefghijklmnopqrstuvwxyz', range(1, 27)))
	sum = 0
	for char in s:
		sum += abc[char]
	return sum


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):
	values = dict(list(zip(string.ascii_lowercase, list(range(1, 27)))))
	input_lst = list(input_str)
	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):
	letters = string.ascii_lowercase
	total = 0
	for i in s:
		total += letters.index(i) + 1
	return total


def words_to_marks(s):
	sum = 0
	d = {alpha: i for (i, alpha) in enumerate('abcdefghijklmnopqrstuvwxyz', start=1)}
	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):
	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):
	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):
	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):
	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
	return sum


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


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


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


import string

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


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)
	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):
	num = 0
	for character in s:
		num = num + ord(character) - 96
	return num


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
	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