Advertisement
big_cee223

Moon1_py

Jan 27th, 2023 (edited)
816
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.80 KB | None | 0 0
  1. food=input('Do you want (1) Original taste (2) Spicy Taste : ')
  2. total=0 #ประกาศตัวแปร Total เพราะใน Function เราไม่สามารถประกาศได้
  3. if food=="1":
  4.     size=input('What size do you want (M/L) : ')
  5.     if size=="m" and "M":
  6.         total=100 #เมื่อป้อน m หรือ M Total จะเปลี่ยนเป็นค่านี้
  7.     elif size=="l" and "L":
  8.         total=150
  9. elif food=="2":
  10.     size=input('What size do you want (M/L) : ')
  11.     if size=="m" and "M":
  12.         total=120
  13.     elif size=="l" and "L":
  14.         total=160
  15. water=input("Do you want water (y/n) : ")
  16. if water=='Y'and'y':
  17.     total+=10 #+= คือ total=total+10 เป็นแบบย่อ
  18. print(f'You order is {total}')
  19.  
  20.  
  21.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement