自变量命名规则
可以将一个数值,或者字符串串附值给自变量,如m=1
中,m
为自变量的名称,1
为自变量的值。 也可以将字符串赋值给自变量 m='hello world'
>>> m=1
>>> print(m)
1
>>> m='hello world'
>>> print(m)
hello world
>>>
如果需要用多个单词来表示自变量,需要加下划线,如m_n='hello world'
请看代码
>>> m_n='hello world'
>>> print(m_n)
hello world
>>>
一次定义多个自变量 a,b,c,d=1,2,3,4
>>> a,b,c,d=1,2,3,4
>>> print(a,b,c,d)
(1, 2, 3, 4)
>>>