Getting wrong output when working with tuple and list in Python <p>Trying to learn some python and I have the following task:</p> <ol> <li>Get a phrase from the user as an input.</li> <li>Check if the input contains a consonant from a consonants tuple\list that I declare in the code.</li> <li>For every consonant in the user input, print the consonant followed by the letter 'o' and the consonant itself.</li> </ol> <p>For example:</p> <ul> <li>User types the word 'something' as an input</li> <li>Output should be: 'sosomometothohinongog' (vowels do not exist in the consonant tuple and hence are not being appended).</li> </ul> <p>This is my code:</p> <pre><code>#!/usr/bin/python consonant = ('b', 'c', 'd', 'f', 'g', 'h', 'j', 'k', 'l', 'm', 'n', 'p', 'q', 'r', 's', 't', 'v', 'w', 'x', 'y', 'z') def isConsonant(user): for consonant in user: print consonant + "o" + consonant var = raw_input("type smth: ") isConsonant(var) </code></pre> <p>Here is what I get:</p> <pre><code>root@kali:~/py_chal# ./5.py type smth: test tot eoe sos tot </code></pre> <p>I have trouble with:</p> <ul> <li>The code treats vowels as consonants even though they are not in the list (notice the 'e').</li> <li>the 'print' method adds a new line - This was solved by importing the sys module and using 'write'.</li> </ul> <p>Any tips are greatly appreciated.</p>