====== LU12.L02 - Hofladen ====== ~~NOCACHE~~ ===== Funktionen ===== def input_int(prompt): """ reads an integer input from the user :param text: the prompt to be shown :return: the integer number """ pass def input_float(prompt): """ reads a decimal number input from the user :param text: the prompt to be shown :return: the decimal number """ pass def find_article(list, name): """ finds an article in the article list :param list: the article list :param name: the article name to be found :return: article or None=not found """ pass ===== Vorgehensschritte ===== * Schritt 1 * Schritt 2 * Schritt 3 - Erstelle eine leere Liste für die Artikel - Eingabe des Artikelnamens - Solange Artikelname nicht ''Exit'' ist - Suche den Artikel in der Liste - Falls keine Artikel gefunden wurde - Erstelle ein neues Artikel-Objekt und speichere es in der Liste - Speichere den Artikelnamen - Eingabe des Preises - Sonst - Ausgabe des aktuellen Bestands - Eingabe der Menge - Addiere die Menge zum Bestand - Eingabe des Artikelnamens - Gib die Artikelliste als Returnwert zurück ===== Sourcecode ===== {{gh>https://github.com/templates-python/m319-lu12-a02-farmshop/blob/solution/article.py}} {{gh>https://github.com/templates-python/m319-lu12-a02-farmshop/blob/solution/shop.py}}