-'s Issues
python基础-变量
变量
-
变量就是一个重复使用的量,也可以成为是一个代号
-
变量命名的规则
- 一般由数字,字母,下划线组成
- 开头不能是数字
- 例如:4min是错误的
-
一般在python中,以下划线开头的内容具有特殊含义,不建议使用
- 例如:_age,_name,理论上符合命名规则,但不推荐使用
-
大小写敏感
- liu和LIU不是一个变量名称
-
推荐:
- 使用具有固定含义的英文单词或者缩写,一般以posix命名规则为主
- 驼峰命名法
- 名称以单词自动连接,并且每个单词首字母大写
- 大驼峰:每个单词首字母均大写
- 在python中给类命名使用此方法,例如:IntOne
- 小驼峰:与大驼峰相反,第一个字母小写
- 在python中一般给普通变量或者函数命名,例如:intOne
- 大驼峰:每个单词首字母均大写
- 名称以单词自动连接,并且每个单词首字母大写
- posix命名规则:
- 多个单词用下划线连接
- 单词全部小写
- 例如:my_first
-
保留字和关键字
- 命名变量必须注意不能和关键字重复
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.