-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfunctions.py
More file actions
53 lines (40 loc) · 1.42 KB
/
functions.py
File metadata and controls
53 lines (40 loc) · 1.42 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
import time
from constants import *
import playsound
def header():
print("********************************************************")
print("*******************COFFEE MACHINE***********************")
print("********************************************************")
time.sleep(0.5)
def select():
while True:
print("1.COFFEE 2.ESPRESSO 3.TEA 4.LATTE")
selection = int(input("Select a Drink: "))
if selection == 1:
print("COFFEE SELECTED AND THE PRICE IS " + str(COFFEE))
price(COFFEE)
elif selection == 2:
print("ESPRESSO SELECTED AND THE PRICE IS " + str(ESPRESSO))
price(ESPRESSO)
elif selection == 3:
print("TEA SELECTED AND THE PRICE IS " + str(TEA))
price(TEA)
elif selection == 4:
print("LATTE SELECTED AND THE PRICE IS " + str(LATTE))
price(LATTE)
else:
print("WRONG INPUT")
reset=input("Press y to buy another drink or quit: ")
if reset != "y":
break
def price(content):
money = int(input("AMOUNT OF MONEY INSERTED: "))
if money == content:
print("ENOUGH MONEY INSERTED")
time.sleep(1)
print("YOUR DRINK IS ON THE WAY")
time.sleep(1)
playsound._playsoundNix('sound.wav',True)
print("FINISHED")
else:
print("NOT ENOUGH MONEY INSERTED")