my assignment is to write a program that asks the user to enter the name of the artist, the name of the art and then how much it is worth. At the end the program should print the average of the values. After that, it wants the program to sort it in alphabetical order by the artists name. all the information should be next to each other. for example
artist name artwork value
Van gouh .... 3.5
This is what i have so far
def main():
numPaintings = 7
totalValue = 0
Paint = numPaintings
numPaintings = input("Enter how many paintings there are")
while numPaintings != 0:
numPaintings = (numPaintings - 1)
pName = raw_input('Enter the Painting Name: ')
pArtist = raw_input('The Artist: ')
pValue = input('And its value (million): ')
totalValue = totalValue + pValue
Average = (totalValue / Paint)
print "the average is", Average
main()
please help thank you