Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- food=input('Do you want (1) Original taste (2) Spicy Taste : ')
- total=0 #ประกาศตัวแปร Total เพราะใน Function เราไม่สามารถประกาศได้
- if food=="1":
- size=input('What size do you want (M/L) : ')
- if size=="m" and "M":
- total=100 #เมื่อป้อน m หรือ M Total จะเปลี่ยนเป็นค่านี้
- elif size=="l" and "L":
- total=150
- elif food=="2":
- size=input('What size do you want (M/L) : ')
- if size=="m" and "M":
- total=120
- elif size=="l" and "L":
- total=160
- water=input("Do you want water (y/n) : ")
- if water=='Y'and'y':
- total+=10 #+= คือ total=total+10 เป็นแบบย่อ
- print(f'You order is {total}')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement