I am trying to figure out how to calculate the score of two merged lists of names. I need to give one point for each character (including spaces between first and last name) plus one point for each vowel in the name. I can currently calculate score for the the lengths of the names but cannot figure out how to include the number of vowels.
a = ["John", "Kate", "Oli"]
b = ["Green", "Fletcher", "Nelson"]
vowel = ["a", "e", "i", "o", "u"]
gen = ((x, y) for x in a for y in b)
score = 0
for first, second in gen:
print first, second
name = first, second
score = len(first) + len(second) +1
for letter in name:
if letter in vowel:
score+1
print score
This is what i currently have and this is the output I get:
John Green
10
John Fletcher
13
John Nelson
11
Kate Green
10
Kate Fletcher
13
Kate Nelson
11
Oli Green
9
Oli Fletcher
12
Oli Nelson
10
This is the output I need:
Full Name: John Green Score: 13
Full Name: John Fletcher Score: 16
Full Name: John Nelson Score: 14
Full Name: Kate Green Score: 14
Full Name: Kate Fletcher Score: 17
Full Name: Kate Nelson Score: 15
Full Name: Oli Green Score: 13
Full Name: Oli Fletcher Score: 16
Full Name: Oli Nelson Score: 14