Code: Alles auswählen
ISBN = {
'9783768825825':['Delius Klasing','MV - Bornholm', Date(2009, 1, 1), 54.90, 2],
'9783768832021':['Delius Klasing','MV - Bornholm', Date(2011, 1, 1), 54.90, 13],
'9783892255598':['Edition Maritim','Rund Rügen', Date(2008, 3, 1), 29.90, 15],
'9783892252368':['Delius Klasing','Küstenhandbuch MV', Date(2006, 3, 1), 29.90, 3],
'9783980672016':['Quick Maritim Medien','Törnplaner/-atlas Peene, Oder, Bodden', Date(2006, 4, 1), 25.00, 5],
'9783768831017':['Delius Klasing','Kieler Bucht und Rund Fünen (2010)', Date(2010, 3, 1), 69.90, 17]
}
def inventur(dictionary):
summe = 0
for key in dictionary.keys():
summe += dictionary[key][3]*dictionary[key][4]
return summe
print(inventur(ISBN))
Aufgabe 4 b) geschafft .. Dictionarys scheinen relativ einfach sein.
Geht die Lösung so?