Question

You work for an art gallery. You have data that represents the title, artist and price...

You work for an art gallery. You have data that represents the title, artist and price of the artworks in the gallery. Your job is to write a program that gets the data and stores it into three lists. Then your program should find the most expensive artwork and print out the name of the artist, the title and the price of the highest price work in the gallery.  

I need help with the python code here, as I am having trouble determining the correct format to print out the highest price item out of the list.

Thanks

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

******************************************************************************************
Please Upvote the answer as it matters to me a lot :)
*****************************************************************************************
As per HomeworkLib expert answering guidelines,Experts are supposed to answer only certain number of questions/sub-parts in a post.Please raise the remaining as a new question as per HomeworkLib guidelines.
******************************************************************************************

n = int(input())
title=[]
artist=[]
price=[]
for i in range(n):
x,y,z= input().split(" ")
title.append(x)
artist.append(y)
price.append(int(z))
ans =0
Name =""
Title=""
for i in range(n):
if price[i]>ans:
ans= price[i]
Title=title[i]
Name=artist[i]
print(Name,Title,ans)
  
  

Add a comment
Know the answer?
Add Answer to:
You work for an art gallery. You have data that represents the title, artist and price...
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 that reads the gallery's inventory from a file called ArtFile.txt or ArtFile.csv...

    write a C++ program that reads the gallery's inventory from a file called ArtFile.txt or ArtFile.csv into the array of artist struct. Then allow the user to look up the art by specifying any field in the record. [The file extracted a selected number of art works from the National Gallery of Art: NGS.gov.] The user should be able to specify a field, and a value for that field, and the program then returns all artworks that match those criteria....

  • I have a python project that requires me to make a password saver. The major part...

    I have a python project that requires me to make a password saver. The major part of the code is already giving. I am having trouble executing option 2 and 3. Some guidance will be appreciated. Below is the code giving to me. import csv import sys #The password list - We start with it populated for testing purposes passwords = [["yahoo","XqffoZeo"],["google","CoIushujSetu"]] #The password file name to store the passwords to passwordFileName = "samplePasswordFile" #The encryption key for the caesar...

  • WE ARE USING PYTHON TO COMPLETE THIS ASSIGNMENT :) THANK YOU! In this programming assignment, you...

    WE ARE USING PYTHON TO COMPLETE THIS ASSIGNMENT :) THANK YOU! In this programming assignment, you will write functions to encrypt and decrypt messages using simple substitution ciphers. Your solution MUST include: a function called encode that takes two parameters: key, a 26-character long string that identifies the ciphertext mapping for each letter of the alphabet, in order; plaintext, a string of unspecified length that represents the message to be encoded. encode will return a string representing the ciphertext. a...

  • Region Country Item Type Sales Channel Order Priority Order Date Order ID Ship Date Units Sold Unit Price...

    Region Country Item Type Sales Channel Order Priority Order Date Order ID Ship Date Units Sold Unit Price Unit Cost Total Revenue Total Cost Total Profit Asia Morocco Clothes Online M ######## 6.68E+08 ######## 4611 109.28 35.84 503890.1 165258.2 338631.8 Sub-Saharan Africa Ghana Office Supplies Online L ######## 6.01E+08 ######## 896 651.21 524.96 583484.2 470364.2 113120 Sub-Saharan Africa Slovakia Beverages Offline L ######## 1.75E+08 ######## 3973 47.45 31.79 188518.9 126301.7 62217.18 For this assignment you have been engaged by an...

  • Your program must meet the following specifications: 1. At program start, assume a stock of 10 nickels, 10 dimes, 10...

    Your program must meet the following specifications: 1. At program start, assume a stock of 10 nickels, 10 dimes, 10 quarters, and 10 pennies. 2. Repeatedly prompt the user for a price in the form xX.xx, where X denotes a digit, or to enter q' to quit 3. When a price is entered a. If the price entered is negative, print an error message and start over requesting either a new price or to quit (indicated by entering a 'q)...

  • IN PYTHON PLEASE...... Process bowlers and their 3 bowling scores. Use my data file below: bowlers2.txt...

    IN PYTHON PLEASE...... Process bowlers and their 3 bowling scores. Use my data file below: bowlers2.txt ( Showed below) And you can also use a while loop to read your file if you prefer. How to average down an array, which you don’t have to do. In this case that would be the game 1 average for all bowlers for example. Find the low average and high average. Start with read the data into arrays/lists and printed out the arrays/lists...

  • In this project, you will work with sales data from Top’t Corn, a popcorn company with...

    In this project, you will work with sales data from Top’t Corn, a popcorn company with an online store, multiple food trucks, and two retail stores. You will begin by inserting a new worksheet and entering sales data for the four food truck locations, formatting the data, and calculating totals. You will create a pie chart to represent the total units sold by location and a column chart to represent sales by popcorn type. You will format the charts, and...

  • If possible please just send the SQL statement. Thank you Each question within deliverable 3 must begin on a new page and be sure to document the question as the title of each item at the top o...

    If possible please just send the SQL statement. Thank you Each question within deliverable 3 must begin on a new page and be sure to document the question as the title of each item at the top of each page. Also, using a 12-point font, include the SQL statement and then provide a screen shot of each query. The screen shots must include both the SQL statement and the results for each item below based on the data entered in...

  • C programming A linked list is a linear data structure that allows us to add and remove items fro...

    c programming A linked list is a linear data structure that allows us to add and remove items from the list very quickly, by simply changing a few pointers. There are many different variations of linked lists. We have studied the doubly-linked, circular, with a dummy-header-node version of a linked list. In the class notes we studied several functions to manipulate a Linked List. For this assignment you must write the code for the following additional linked list functions: addFirst,...

  • Can you please provide the formula for the worksheet also. CASE PROBLEMS Level 1- Analyzing Sales...

    Can you please provide the formula for the worksheet also. CASE PROBLEMS Level 1- Analyzing Sales for Crèmes Ice Cream Judd Hemming is the eastern regional marketing manager for Crèmes Ice Cream. Eac quarter, he completes two separate analyses: an analysis comparing ice cream flavor sale volumes from all regional locations with the same quarter sales volumes from the previou year and an analysis comparing total sales in dollars, including mean, median, mode, and standard deviation, of sales by store....

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
ADVERTISEMENT