Addition with Python if statement

Preparation
>>> import random
>>> combs =[]
>>> for x in["cheeseburger","Hamburger","Tomato burger"]:
	for y in["potato","salad"]:
		for z in["Shake","Cola","ダイエットCola"]:
			combs.append((x,y,z))

#Preparation

>>> combs
[('cheeseburger', 'potato', 'Shake'), ('cheeseburger', 'potato', 'Cola'), ('cheeseburger', 'potato', 'ダイエットCola'), ('cheeseburger', 'salad', 'Shake'), ('cheeseburger', 'salad', 'Cola'), ('cheeseburger', 'salad', 'ダイエットCola'), ('Hamburger', 'potato', 'Shake'), ('Hamburger', 'potato', 'Cola'), ('Hamburger', 'potato', 'ダイエットCola'), ('Hamburger', 'salad', 'Shake'), ('Hamburger', 'salad', 'Cola'), ('Hamburger', 'salad', 'ダイエットCola'), ('Tomato burger', 'potato', 'Shake'), ('Tomato burger', 'potato', 'Cola'), ('Tomato burger', 'potato', 'ダイエットCola'), ('Tomato burger', 'salad', 'Shake'), ('Tomato burger', 'salad', 'Cola'), ('Tomato burger', 'salad', 'ダイエットCola')]


#Execution command

>>> combs[(random.randint(1,len(combs)+1))]

#Display example

>>> combs[(random.randint(1,len(combs)+1))]
('cheeseburger', 'salad', 'Diet cola')

>>> combs[(random.randint(1,len(combs)+1))]
('Hamburger', 'salad', 'Cola')

I can proceed to the above without delay.

>>> if x == "Hamburger":
	X = 120
elif x == "cheeseburger":
	X = 100
elif x=="Tomato burger":
	X = 200

>>> if y == "salad":
	Y = 150
elif y == "potato":
	Y = 100
	
>>> if z == "Shake":
	Z = 120
elif z =="Cola": 
	Z = 100
elif z =="Diet cola":
	Z=150

As

>>>print(combs[(random.randint(1,len(combs)+1))],X+Y+Z)

Even if you type. The calculation part of X + Y + Z is the same value every time

('cheeseburger', 'potato', 'Cola') 500
('Tomato burger', 'potato', 'Shake') 500

So how can I get the calculation part to work every time?

Recommended Posts

Addition with Python if statement
Python if statement
[Python] if statement
Python basic if statement
[Python] What is a with statement?
[python] Correct usage of if statement
[Python] File operation using if statement
Sugoroku game and addition game with python
FizzBuzz with Python3
Scraping with Python
[Python] Super easy test with assert statement
Statistics with python
[Introduction to Udemy Python3 + Application] 33. if statement
Scraping with Python
Unfamiliar if statement
Twilio with Python
Integrate with Python
Play with 2016-Python
AES256 with python
python starts with ()
with syntax (Python)
Python exec statement
Bingo with python
Zundokokiyoshi with python
Python assert statement
Excel with Python
Microcomputer with Python
Cast with python
[Introduction to Python] How to judge authenticity with if statement (True and None)
Python with Progate (dictionary, while statement, break, continue)
Generate an insert statement from CSV with Python.
Serial communication with Python
Django 1.11 started with Python3.6
Primality test with Python
Python with eclipse + PyDev.
Socket communication with Python
Data analysis with python 2
Scraping with Python (preparation)
Try scraping with Python.
Learning Python with ChemTHEATER 03
"Object-oriented" learning with python
Run Python with VBA
Handling yaml with python
Solve AtCoder 167 with python
Serial communication with python
[Python] Use JSON with Python
Python basics ② for statement
Learning Python with ChemTHEATER 05-1
Learn Python with ChemTHEATER
Run prepDE.py with python3
1.1 Getting Started with Python
Collecting tweets with Python
Binarization with OpenCV / Python
3. 3. AI programming with Python
Kernel Method with Python
Non-blocking with Python + uWSGI
Scraping with Python + PhantomJS
Posting tweets with python
Drive WebDriver with python
Use mecab with Python3
[Python] Redirect with CGIHTTPServer