[Python] Variable (definition, output, value change)

Variable definition

** Variable name = Value ** "" Can also be "". However, "" is easier to judge half-width and full-width. Two or more words should be separated by _.

name = "chikazu"
user_name = "chikazu"

Variable output

For variables, do not add "" or ``.

print(name)

Change variable value

① Overwrite price = 100 with 200. Just define it as it is.

price = 100
print(price)

price = 200
print(price)

(2) Assign a numerical value calculated to price = 100 to a variable. The example is +, but other four arithmetic operations are also possible. This time, 300 is output at 100 + 200.

price = 100
print(price)

price += 200
print(price)

Recommended Posts

[Python] Variable (definition, output, value change)
Python underscore variable
python learning output
Python interpreter prompt change
python variable expansion, format
Python variable length assignment?
python input and output
Python audio input / output
Output python execution time
Japanese output in Python
Basics of python: Output
Change Maya Python Timeline
Change the standard output destination to a file in Python
[Selenium] Change log output destination when executing phantomjs in python3
[python] Value of function object (?)
Try Python output with Haxe 3.2
Website change monitoring using python
Petit stray Python version output
[Python] Change dtype with pandas
Change python version using pyenv
[Python] numpy.empty initial value setting
How to change Python version
Read Fortran output in python
Python> dictionary> get ()> optional value