-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpizza ordering dialogue.py
56 lines (50 loc) · 1.85 KB
/
pizza ordering dialogue.py
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
53
54
55
56
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Sat Oct 5 14:39:29 2019
@author: aishamalik
"""
orders = []
def select_meal():
meal = input("Hello, would you like a pizza or salad? ")
order = meal.lower()
if order == "pizza":
pizza()
elif order == 'salad':
salad()
else:
print("Your order has been placed! Goodbye.")
def pizza():
siz = input("Small, medium or large? ")
size = siz.lower()
def toppings():
top = input ("Add a topping: pepperoni, mushrooms, spinach, jalapenos or say 'done'. ")
topping = []
while top != "done":
topping.append(top)
top = input ("Add a topping: pepperoni, mushrooms, spinach, jalapenos or say 'done'. ")
if topping == []:
final = "one " + size + " pizza"
orders.append(final)
eat = " and ".join(orders)
print("You ordered", "{}.".format(eat), "Place another order or say 'done' ")
else:
alltop = "with " + ' and '.join(topping)
final = "one " + size + " pizza "+ alltop
orders.append(final)
eat = " and ".join(orders)
print("You ordered","{}.".format(eat), "Place another order or say 'done' ")
select_meal()
toppings()
def salad():
salad = input("Would you like a garden salad or a greek salad? ")
def dressing():
dress = input("Please choose a dressing: vinaigrette, ranch, lemon or italian? ")
salad_order = "one " + salad + " salad with " + dress + " dressing"
orders.append(salad_order)
eat = " and ".join(orders)
print("You ordered", "{}.".format(eat), "Place another order or say 'done' ")
select_meal()
dressing()
#gotta make a nesting doll type whole function, write this on paper before writing the code.
select_meal()