Arama butonu
Bu konudaki kullanıcılar: 1 misafir
3
Cevap
598
Tıklama
0
Öne Çıkarma
Python Basit Ödev Lütfen Yardım
H
8 yıl
Er
Konu Sahibi

#Suppose you have a dictionary of "cellPhone={}" with the following data

cellPhone = {}

cellPhone[0] = {"brand":"iphone", "price":5000, "sales":1266883}
cellPhone[1] = {"brand":"samsung", "price":3500, "sales":845869}
cellPhone[2] = {"brand":"nokia", "price":1200, "sales":312008}
cellPhone[3] = {"brand":"vestel", "price":600, "sales":76853}
cellPhone[4] = {"brand":"lg", "price":2860, "sales":858694}
cellPhone[5] = {"brand":"htc", "price":4689, "sales":288963}

# a) Write a function with the name "total" which returns the total earnings of all 6 brands
#(Hint: earning = price * sales)

def total():
pass #you should complete the rest


# b) Write a function with the name "share" which adds a new "share" key to each phone in the data
#with the value to represent the total market share of the product
#(Hint: cellPhone[0] => {"brand":"iphone", "price":5000, "sales":1266883, "share":1266883*5000/total()}

def share():
pass #you should complete the rest


#Note: Deliver both your solution scripts and results on white paper...
#Please do not e-mail your homework...

bunu nasıl yapıcaz lütfen 4 arkadaş giriştik bir şey yapamadık