Python 中寫 x=5 的意思是指
x → Variable (像是容器/變數)
= → 中間的等號是 Assign
5 → 是value
所以是指把5assign 到x 這個變數variable 中
所以 Python 中 = (assignment operator 不等於數學中等號的概念)
運作的方式是把等號右邊的value input 到等號左邊
這也代表為什麼是 寫x=6 , 改寫成 6 = x 會有問題
x = 6
print(x)
6 = x # show
print(x)
---------------------------------
[Running] python -u "d:\\2022_python_全攻略\\11. Functions for Numbers"
File "d:\\2022_python_\\u5168\\u653b\\u7565\\11. Functions for Numbers", line 29
6 = x
^
SyntaxError: cannot assign to literal
[Done] exited with code=1 in 0.087 seconds