Question

Create a program that has 4 lists. One list has the title of 5 books. Another...

Create a program that has 4 lists.

One list has the title of 5 books. Another list has the price of the 5 books and another list has the quantity of the 5 books.

Put all 3 lists into a Master List(the fourth list).

Using a loop print out the Title of each book and the value of the inventory (quantity * price)

# The book "100 Years of Solitude" has an inventory value of $568.78

# Use Python

0 0
Add a comment Improve this question Transcribed image text
Answer #1

title_list = [
       '100 Years of Solitude Part 1',
       '100 Years of Solitude Part 2',
       '100 Years of Solitude Part 3',
       '100 Years of Solitude Part 4',
       '100 Years of Solitude Part 5'
   ]

price_list = [100, 105, 110, 115, 120]

quantity_list = [1, 2, 3, 4, 5]

final_list = []

for i in range(5):
   price = price_list[i] * quantity_list[i];
   s = 'The book "' + title_list[i] + '" has an inventory value of $' + str(price)
   final_list.append(s)


for x in final_list:
   print(x)

Add a comment
Know the answer?
Add Answer to:
Create a program that has 4 lists. One list has the title of 5 books. Another...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Write a C program to create a list of books details. The details of a book...

    Write a C program to create a list of books details. The details of a book include title, author, publisher, publishing year, no. of pages , price Perform the following with respect to the list of books created Display all the details of books written by a given author. Sort the details of books in the increasing order of price. Display the details of books published by a given publisher in a given year. Sort the list of books in...

  • please use C++ write a program to read a textfile containing a list of books. each...

    please use C++ write a program to read a textfile containing a list of books. each line in the file has tile, ... Question: Write a program to read a textfile containing a list of books. each line in the file has tile, ..... write a program to read a textfile containing a list of books. each line in the file has tile, ... Question: Write a program to read a textfile containing a list of books. Each line in...

  • Python help: Create two lists of 5 elements. The first list should be a series of...

    Python help: Create two lists of 5 elements. The first list should be a series of questions whose answer is either "T" or "F" (true or false). The second list should be the correct answers to those questions ("T" or "F"). Write a program that asks the user each question in the question list and compares their answer to the answer in the answer list. Print out whether or not they got the question correct and print out their final...

  • in python: Write a program that uses a two-dimensional list that has 4 rows, with 5...

    in python: Write a program that uses a two-dimensional list that has 4 rows, with 5 columns in each row. The program should do the following things 1. Create or fill in the list so that it has random numbers between 0 and 50. 2. Print the entire list using a loop.

  • Help needed related python ! Thanx :) #First let's ask the user for one of their...

    Help needed related python ! Thanx :) #First let's ask the user for one of their favorite book. # Now let's use concatenation to ask who wrote this book. # Create an empty dictionary to hold the favorite books and authors. # 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?...

  • In Python! Create the program that print out only odd numbers 1,3,5,7,9 Use either a while...

    In Python! Create the program that print out only odd numbers 1,3,5,7,9 Use either a while loop or a for loop to print only odd numbers 1, 3, 5, 7, 9 *tip: you can use range () function, or a condition with ‘break’ (e.g, while count < 10) In python!: Create a program that print out 12 months of a year and associated numbers (e.g., January 1, February 2…). Two lists should be created, and then loop through the list...

  • ***C++ ONLY*** Menu driven program First load an array(lists) with the values 3, 4, 84, 5,...

    ***C++ ONLY*** Menu driven program First load an array(lists) with the values 3, 4, 84, 5, 2, 47, and 7 in this order Then sort the array(list) Create a program with a menu, with choices 1 for factorial (single value, which everyone will use 20!), 2 for median value , 3 for average, 4 for maximum, 5 for minimum, and 6 to end the program. Use a do loop (not while) Python does not have a Do loop, so instead...

  • ***C++ Program ONLY*** Menu driven program First load an array(lists) with the values 3, 4, 84,...

    ***C++ Program ONLY*** Menu driven program First load an array(lists) with the values 3, 4, 84, 5, 2, 47, and 7 in this order Then sort the array(list) Create a program with a menu, with choices 1 for factorial (single value, which everyone will use 20!), 2 for median value , 3 for average, 4 for maximum, 5 for minimum, and 6 to end the program. Use a do loop (not while) Python does not have a Do loop, so...

  • This assignment requires using C++ language Your program will be creating 10 library books. Each library...

    This assignment requires using C++ language Your program will be creating 10 library books. Each library book will have title, author and publishing year. Each library book will be stored as a structure and your program will have an array of library books (an array of structures). You will create a corresponding array of book genres: Mystery, Romance, Fantasy, Technology, Children, etc. If the first element of the array is storing information about a book titled : "More about Paddington",...

  • I need this python program to access an excel file, books inventory file. The file called...

    I need this python program to access an excel file, books inventory file. The file called (bkstr_inv.xlsx), and I need to add another option [search books], option to allow a customer to search the books inventory, please. CODE ''' Shows the menu with options and gets the user selection. ''' def GetOptionFromUser(): print("******************BookStore**************************") print("1. Add Books") print("2. View Books") print("3. Add To Cart") print("4. View Receipt") print("5. Buy Books") print("6. Clear Cart") print("7. Exit") print("*****************************************************") option = int(input("Select your option:...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT