Update 2
This commit is contained in:
parent
b9843e5485
commit
56fe3621c2
@ -121,7 +121,7 @@ def normal_mode():
|
|||||||
product_price=c.execute("SELECT price FROM products WHERE id=?", (int(product_id),)).fetchone()[0]
|
product_price=c.execute("SELECT price FROM products WHERE id=?", (int(product_id),)).fetchone()[0]
|
||||||
# Ask the amount of the product
|
# Ask the amount of the product
|
||||||
product_amount=int(input("Bitte Anzahl des Produktes Eingeben: "))
|
product_amount=int(input("Bitte Anzahl des Produktes Eingeben: "))
|
||||||
sum_of_price=product_price*product_amount
|
sum_of_price=round(product_price*product_amount,2)
|
||||||
# Print the price of the sum
|
# Print the price of the sum
|
||||||
print("Summe:%s€" % sum_of_price)
|
print("Summe:%s€" % sum_of_price)
|
||||||
# Ask if the user wants to continue
|
# Ask if the user wants to continue
|
||||||
@ -183,6 +183,10 @@ def payment(sum_of_price):
|
|||||||
rest_cent_5=rest_cent//5
|
rest_cent_5=rest_cent//5
|
||||||
rest_cent=rest_cent-rest_cent_5*50
|
rest_cent=rest_cent-rest_cent_5*50
|
||||||
|
|
||||||
|
# 1 Cent
|
||||||
|
rest_cent_1=rest_cent//1
|
||||||
|
rest_cent=rest_cent-rest_cent_1*1
|
||||||
|
|
||||||
if rest_euro_10 >=1:
|
if rest_euro_10 >=1:
|
||||||
print ("Sie bekommen %smal 10€" % rest_euro_10)
|
print ("Sie bekommen %smal 10€" % rest_euro_10)
|
||||||
if rest_euro_5 >=1:
|
if rest_euro_5 >=1:
|
||||||
@ -192,13 +196,15 @@ def payment(sum_of_price):
|
|||||||
if rest_euro_1 >=1:
|
if rest_euro_1 >=1:
|
||||||
print ("Sie bekommen %smal 1€" % rest_euro_1)
|
print ("Sie bekommen %smal 1€" % rest_euro_1)
|
||||||
if rest_cent_50 >=1:
|
if rest_cent_50 >=1:
|
||||||
print ("Sie bekommen %smal 50 Cent: %s" % rest_cent_50)
|
print ("Sie bekommen %smal 50 Cent:" % rest_cent_50)
|
||||||
if rest_cent_20 >=1:
|
if rest_cent_20 >=1:
|
||||||
print ("Sie bekommen %smal 20 Cent: %s" % rest_cent_20)
|
print ("Sie bekommen %smal 20 Cent:" % rest_cent_20)
|
||||||
if rest_cent_10 >=1:
|
if rest_cent_10 >=1:
|
||||||
print ("Sie bekommen %smal 10 Cent: %s" % rest_cent_10)
|
print ("Sie bekommen %smal 10 Cent:" % rest_cent_10)
|
||||||
if rest_cent_5 >=1:
|
if rest_cent_5 >=1:
|
||||||
print ("Sie bekommen %smal 5 Cent: %s" % rest_cent_5)
|
print ("Sie bekommen %smal 5 Cent:" % rest_cent_5)
|
||||||
|
if rest_cent_1 >=1:
|
||||||
|
print("Sie bekommen %smal 1 Cent" % rest_cent_1)
|
||||||
|
|
||||||
normal_mode()
|
normal_mode()
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user