当前位置:网站首页>05-变量及标识符
05-变量及标识符
2022-04-22 05:39:00 【ʕ·͡ˑ·ཻʔ**ʕ·͡ˑ·ཻʔ】
目录
一、什么是变量
-
变量在计算机语言中是能储存计算结果或表示某个数据值。
二、变量的定义
-
变量名 = 数据值
三、说明
-
变量名自定义,要满足‘标识符’命名规则。
-
变量是用来保存数据的, 必须先定义后使用。(必须先存入数据才能获取数据)。
-
直接使用变量名,即可使用变量中存储的数据。
-
数据值为要存储的数据,可以为不同的数据类型。
-
单等号用于赋值,不具备比较功能。
四、什么是标识符
-
标识符是用户编程时使用的名字,用于给变量、函数、类等命名。
五、标识符的规则
-
由数字、字母、下划线组成。
-
不能使用数字开头。
-
不能使用python内置字段。
-
严格区分大小写。
-
不建议使用中文。
五、python中的关键字
六、标识符命名习惯
-
驼峰命名
-
大驼峰:每个单词首字母大写,例如“MyName”.
-
小驼峰:第二份单词开始首字母大写,例如“myName”.
-
下划线命名: 每个单词之间使用下划线连接,例如“my_name”.
版权声明
本文为[ʕ·͡ˑ·ཻʔ**ʕ·͡ˑ·ཻʔ]所创,转载请带上原文链接,感谢
https://blog.csdn.net/qq_46071165/article/details/124268862
边栏推荐
- Dictionary tree template
- Two ways of JS array value
- LeetCode 514. 自由之路--动态规划
- 《PyTorch深度学习实践》Lecture_11 卷积神经网络进阶 Convolutional Neural Network
- 苹果 cms 自定义对接微信公众号
- C language -- classic 100 questions
- 蓝桥杯冲刺——二进制枚举
- 蓝桥冲刺专题——BFS
- LeetCode 467. Dynamic programming -- the only substring in the surrounding string
- LeetCode 2049. Count the number of nodes with the highest score -- traversal of the tree
猜你喜欢

蓝桥杯31天冲刺 Day17

蓝桥冲刺专题——BFS

Data processing code record

vscode cmake-tools launching. JSON usage document (garbage translation)

Cytoscape installation tutorial

Machine learning -- drawing P-R curve and ROC curve with iris data set

Data mining -- decision tree classification

Uniapp: hbuilderx runs the uniapp project to the night God simulator

蓝桥杯冲刺——并查集

Miniconda source swap (add image)
随机推荐
Interpretation of imencode source code
Exploration des données - regroupement
Musk updates wechat push (Dog Coin)
最长公共子序列(动态规划)
The breakpoint will not currently be hit No symbols have been loaded for this document.
LeetCode 2049. Count the number of nodes with the highest score -- traversal of the tree
SQL面试题总结(更新中)
【2022阿里安全】真实场景篡改图像检测挑战赛 决赛rank17方案分享
蓝桥杯31天冲刺 Day14
Miniconda source swap (add image)
layer关闭弹窗,刷新父页面
C language -- classic 100 questions
Cytoscape安装教程
vscode cmake-tools launching. JSON usage document (garbage translation)
‘PdfFileWriter‘ object has no attribute ‘stream‘
Langue C - 100 questions classiques
golang 合并两个有序的数组(笔试题)
子集和问题(回溯&分支限界)
蓝桥杯冲刺——二进制枚举
LeetCode 2044. Count the number of subsets that can get the maximum value by bit -- depth traversal