var:
变量
PyCharm变量是为了存一个东西,是为了在整个程序中调用,变量存在内存中。定义变量:变量名,赋值。变量定义的规则:1、变量名只能是字母、数字或者下划线的组合 2、变量名的第一个字符不能是数字;3、以下关键字不能声明为变量名(and\as\assert\break\def……)变量分两种:变量和常量,定义常量方法:PIE = (变量名要大写代表是常量)var.py
---------------------------------------------------------------
print("Hello World") name = "Alex Li" print ("My name is", name) print (name) print ("My name is ", name) name2 = name print("My name is ",name,name2) msg = ''' name = "PaoChe Ge" print(name,name2) gf_of_oldboy = "Chen rong hua" GFOfOldboy = "Chen rong hua"''' print(msg) --------------------------------------------