Calculating score of merged string
<p>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. </p>

<pre><code>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)

for u, v in gen:
    print u, v
</code></pre>

<p>I am struggling to figure out what to do. Any help would be greatly appreciated.</p>

<pre><code>for first, second in gen:
    name = " ".join(first, second)
    score = 0
    for letter in name:
        if letter in vowel:
            score += 1
    score += len(name)
</code></pre>

<p>It's easier to have them as a string, you can then loop over that string. One point per character is easy, that's just length of the string. If vowel is one extra letter, just loop over letters and if vowel add a point. Voila!</p>

python string list