GOGO百貨週年慶「全館八折,滿萬七折」活動中,請讀取採購總金額 ,計算折扣,並顯示折扣後該收取的總金額。
例如:23456元滿萬打七折,應付16419.2元。9000元打八折,應付7200.0元


➥cost = int(input("請輸入消費金額:"))
➥if (cost >= 10000):
➥ discount = cost * 0.7
➥ print(cost, "元滿萬打七折,應付", discount, "元")
➥else:
➥ discount = cost * 0.8
➥ print(cost, "元打八折,應付", discount, "元")

➥cost = int(input("請輸入消費金額:"))
➥if (cost >= 10000):
➥ discount = cost * 0.7
➥ print(cost, "元滿萬打七折,應付", discount, "元")
➥else:
➥ discount = cost * 0.8
➥ print(cost, "元打八折,應付", discount, "元")

程式執行結果顯示:
FlowInfo1 FlowInfo2 FlowInfo3 FlowInfo4 FlowInfo5