Best writers. Best papers. Let professionals take care of your academic papers

Order a similar paper and get 15% discount on your first order with us
Use the following coupon "FIRST15"
ORDER NOW

CODE

My following code works but I am having one issue and that’s making a new line at a particular section. However, I tried “n” after “Choose an option:” and still doesn’t give me the output I need.

MY CODE

movies = {

Need assignment help for this question?

If you need assistance with writing your essay, we are ready to help you!

OUR PROCESS

Order

Payment

Writing

Delivery

Why Choose Us: Cost-efficiency, Plagiarism free, Money Back Guarantee, On-time Delivery, Total Сonfidentiality, 24/7 Support, 100% originality

   2005:[[‘Munich’, ‘Steven Spielberg’]],

   2006:[[‘The Prestige’, ‘Christopher Nolan’], [‘The Departed’, ‘Martin Scorsese’]],

   2007:[[‘Into the Wild’, ‘Sean Penn’]],

   2008:[[‘The Dark Knight’,’Christopher Nolan’]],

   2009:[[‘Mary and Max’, ‘Adam Elliot’]],

   2010:[[‘The King’s Speech’,’Tom Hooper’]],

   2011:[[‘The Artist’, ‘Michel Hazanavicius’], [‘The Help’, ‘Tate Taylor’]],

   2012:[[‘Argo’, ‘Ben Affleck’]],

   2013:[[’12 Years a Slave’, ‘Steve McQueen’]],

   2014:[[‘Birdman’, ‘Alejandro G. Inarritu’]],

   2015:[[‘Spotlight’,’Tom McCarthy’]],

   2016:[[‘The BFG’, ‘Steven Spielberg’]]

}

# Prompt the user for a year 

year = int(input(‘Enter a year between 2005 and 2016:n’))

if year in movies.keys():

   for movie in movies[year]:

       print(movie[0] +’, ‘+ movie[1])

else:

   print(‘N/A’)

choice =”

while choice != ‘q’:

# Displaying the title(s) and directors(s) from that year

# Display menu

   print(‘nMENU’)

   print(‘Sort by:ny – Yearnd – Directornt – Movie title’)

   print(‘q – Quitn’)

   choice = input(‘Choose an option:’)

   if choice == ‘q’:

       break

   elif choice == ‘y’:

       for year in sorted(movies.keys()):

           print(‘n’ + str(year) + ‘:’)

           for movie in movies[year]:

               print(‘t’ + movie[0] + ‘, ‘ + movie[1])

   elif choice == ‘d’:

       director = []

       for year in movies.keys():

           for movie in movies[year]:

               if movie[1] not in director:

                   director.append(movie[1])

       for d in sorted(director):

           print(‘n’ + d + ‘:’)

           for year in movies.keys():

               for mov in movies[year]:

                   if mov[1] == d:

                       print(‘t’ + mov[0] + ‘, ‘ + str(year))

   elif choice == ‘t’:

       title = []

       for year in movies.keys():

           for movie in movies[year]:

               if movie[0] not in title:

                   title.append(movie[0])

       for t in sorted(title):

           print(‘n’ + t + ‘:’)

           for year in movies.keys():

               for mov in movies[year]:

                   if mov[0] == t:

                       print(‘t’ + mov[1] + ‘, ‘ + str(year))

   else:

       print(‘Error:Invalid choice! Try again.’)

“Order a similar paper and get 15% discount on your first order with us
Use the following coupon
“FIRST15”

Order Now