标签:定义 The not esc 第一个 container format bsp out
变量的作用
昵称,代指内存里某个地址中保存的内容存储程序的中间结果,方便后面的程序调用
官方介绍 :Variables are used to store information to be referenced and manipulated in a computer program. They also provide a way of labeling data with a descriptive name, so our programs can be understood more clearly by the reader and ourselves. It is helpful to think of variables as containers that hold information. Their sole purpose is to label and store data in memory. This data can then be used throughout your program.
声明 变量
“变量名” + “赋值符号” + “变量的值”
eg : name = alex
变量定义的规则
变量的赋值
name1 = "anna"
name2 = "wuan"
变量name1,变量name2分别指向一块内存地址
name1 = “anna”
name2 = name1
变量name1,name2指向同一内存地址,修改name1的值,那么的内容不变
常量
常量即指不变的量,如pai 3.141592653..., 或在程序运行过程中不会改变的量
在Python中没有一个专门的语法代表常量,程序员约定俗成用变量名全部大写代表常量
标签:定义 The not esc 第一个 container format bsp out
原文地址:https://www.cnblogs.com/leiyiming/p/8902190.html