Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def CancelOrders():
- while True:
- orderID = input("Please enter your order ID (You will need to pay 20% of the total price): ")
- with open('Temp.txt') as f:
- if orderID in f.read():
- print("You have paid")
- f.seek(0)
- total = 0
- for line in f:
- if orderID in line:
- total_price = line[48:60]
- total = total_price
- total = float(total)
- total = total*0.2
- total = (round(total, 2))
- finaltotal = total
- print("Your total is: "+str(finaltotal))
- lines = f.readlines()
- f = open("Temp.txt","w+")
- for line in lines:
- if line[0:12].lower().strip() != orderID.lower().strip():
- f.write(line)
- f.close()
- break
- else:
- print("OrderID does not exist.")
- Menu()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement