Question: Help needed related python ! Thanx :) #First let's ask the user for one of their favorite book. book = input(What is your favorite book?
Help needed related python ! Thanx :)
#First let's ask the user for one of their favorite book. book = input("What is your favorite book? ") # Now let's use concatenation to ask who wrote this book. author = input("Who is the author of " +book+ "? ") # Create an empty dictionary to hold the favorite books and authors. favorite_books = {}
# Use a for loop to prompt the user to enter 5 of their favorite books. # A general structure is given below.
for book in favorite_book range(5): print (book) favorite_book = input("What is one of your favorite books? ") # Prompt for a favorite book. favorite_author = input("Who is the author of "+ favorite_book +"? ") # Prompt for author of the book. # Add the favorite book & author to the favorite_books dictionary. # The book title is the key, the author is the value. # favorite_books[...] = ...
# Here is the list title. print("A list of my favorite books, a.k.a. books I can recommend to others!")
# Complete the following for loop to print out the dictionary. # Here is what a print out should look like: # "Oryx & Crake" by Maragaret Atwood for each in favorite_books: print()
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
