Q:

Iterating over a dictionary while only printing once

I'm trying to get it to print the value only once. it seems to be printing it as many times as i have keys in the dict
movies = {
    '2005': ["Munich", "Steven Spielberg"],
    '2006': ["The prestige", "Christopher Nolan", "The Departed", "Martin Scorsese"],
    '2007': ["Into the Wild", "Sean Penn"]
    }

choice =input("Enter a year between 2005 and 2016:\n")

for i in movies:
    print(movies[choice],'\n')

my output for an entry of 2005 will be Munich, Steven Spielberg 3 times when i only need it once.
thanks

A:

You loop should be
for movie in movies[choice]:
    print(movie)

You are iterating over keys of dictionary - and since there are 3 keys, your line is printed 3 times

