Python :: Aufgabe #246 :: Lösung #2
5 Lösungen

#246
Preise im Copy-Shop für Kopien
Anfänger - Python
von DragStar
- 20.03.2020 um 11:53 Uhr
In einem Copy-Shop gilt folgende Preisliste:
01 - 49 Seiten kostet 0,10 Euro pro Seite
50 - 99 Seiten kostet 0,09 Euro pro Seite
100 - 199 Seiten kostet 0,08 Euro pro Seite
ab 200 Seiten kostet 0,06 Euro pro Seite
Erstellen Sie ein Programm, welches nach Eingabe der Anzahl der Kopien den Gesamtpreis ausgibt.
01 - 49 Seiten kostet 0,10 Euro pro Seite
50 - 99 Seiten kostet 0,09 Euro pro Seite
100 - 199 Seiten kostet 0,08 Euro pro Seite
ab 200 Seiten kostet 0,06 Euro pro Seite
Erstellen Sie ein Programm, welches nach Eingabe der Anzahl der Kopien den Gesamtpreis ausgibt.
#2

von satn1241 (3090 Punkte)
- 01.04.2020 um 13:48 Uhr

# Copy-Shop print("Wie viele Seiten möchten Sie drucken?") anzahl = int(input()) if anzahl < 50: preis = 0.10 if 49 < anzahl < 99: preis = 0.09 if 99 < anzahl < 199: preis = 0.08 if anzahl > 199: preis = 0.06 kosten = anzahl*preis print("Sie möchten also", anzahl,"Seiten drucken.") print("Bei einem Preis von",round(preis,2),"Euro pro Seite macht das:", round(kosten,2),"Euro")
Kommentare:
Für diese Lösung gibt es noch keinen Kommentar
Seite 1 von 0
1