Python is not printing my input in while loop
<p>I'm having trouble with my python code as it is not printing anything after I input something into the compiler. </p>

<p>I'm trying to write code that uses a while loop and allows the user to enter an album's artist and title. Then I should be able to call <code>make_album</code> with the user's input and print the dictionary that's created. </p>

<p>However, after I enter the artist and title, nothing prints.</p>

<p>Here is my python code:</p>

<pre><code>def make_album(artist_name, album_title, num_tracks = ''):
    """Return artist and album title name."""
    CD1 = {'sonic': artist_name, 'his world': album_title}
    CD2 = {'shadow': artist_name, 'all hail shadow': album_title}
    CD3 = {'silver': artist_name, 'dream of an absolution': album_title}
    if num_tracks:
        CD = artist_name + ' ' + album_title + ' ' + num_tracks
    else:
        CD = artist_name + ' ' + album_title
    return CD.title()

while True:
    print("\nEnter album's artist and title: ")
    print("\nEnter 'q' at anytime to quit")

    a_name = input("Artist name: ")
    if a_name == 'q':
        break

    a_title = input("Album title: ")
    if a_title == 'q':
        break

make_album(a_name, a_title)
formatted_album = make_album(a_name, a_title)
print(formatted_album)
</code></pre>

<p>Does anyone have any idea as to what I may be doing wrong? Any feedback would be greatly appreciated. </p>

<p>Thank you for your time.</p>

<p>I suggest to print out the type of your "a_name" and see what it says.</p>

<p>My guess is that your usage of <code>input</code> does not yield what you expect.  Try <code>raw_input</code> instead.</p>

<p>The python course has the following to say on <a href="http://www.python-course.eu/input.php" rel="nofollow"><code>input</code></a>:</p>

<blockquote>
  <p>The input of the user will be interpreted. If the user e.g. puts in an
  integer value, the input function returns this integer value. If the
  user on the other hand inputs a list, the function will return a list.</p>
</blockquote>

<p>That means that if you want a string, e.g. <code>'q'</code>, you have to enter, literally, <code>'q'</code>.</p>

<p>You may want your input to be takes as a string, no matter what you type, and leave interpretation up to your implementation. Then you better call <code>raw_input</code>.</p>

python