当前位置:网站首页>Python learning Day1 -- Basic Learning
Python learning Day1 -- Basic Learning
2020-11-08 08:04:00 【osc_1mofhvr6】
1.python
python It's an interpretive language , It's also a weakly typed programming language .
2. Variable
A variable is a name used to store data , Can be called multiple times during program execution .
2.1 Naming rules for variables
1. There are letters 、 Numbers 、 Underline composition
2. Cannot start with a number , It can't be pure numbers
3. It can't be a keyword
4. Case sensitive
Be careful
1. Variable names should not be too long
2. The variable name has to make sense
3. The variable name should not be in Chinese
4. It can be named hump and underline
Hump naming :ageSexFamel, Except for the first letter words, the first letters of other words are capitalized
Underline naming :age_sex_famel
3. data type
int ( Integer types ), You can do operations ,+, -, * ,/ ,%( Remainder ) ,//( integer )

str ( String type ), It can be spliced and repeated ,+ ( String splicing )*( Duplicate string ), Use single quotes , Double quotes , All three quotes are strings

bool( Boolean value ), Only True and False Two values

4. Conditional statements if else
- have only if Conditional statements
if Conditions :
Code block
The execution process is : When conditions hold , Execute code block

2.if && else
if Conditions :
Code block 1
else:
Code block 2
Execute the process , When conditions hold , Execute code block 1, Otherwise, execute the code block 2, Two inside execution 1 individual .

3.if && elif && else
if Conditions 1:
Code block 1
elif Conditions 2:
Code block 2
…
else:
Code block n
Execute the process : If the conditions are met 1, Just execute the code block 1, If the conditions are met 2, Just execute the code block 2, If all the conditions are not met , execute else The following code block , From the top down , Execute sequentially , If there are conditions , The program to stop .
版权声明
本文为[osc_1mofhvr6]所创,转载请带上原文链接,感谢
边栏推荐
- Game mathematical derivation AC code (high precision and low precision multiplication and division comparison) + 60 code (long long) + 20 point code (Full Permutation + deep search DFS)
- Wanxin Finance
- Idea - the. IML file was not automatically generated by the project
- Experience the latest version of erofs on Ubuntu
- Visual Studio 2015 未响应/已停止工作的问题解决
- Blazor 准备好为企业服务了吗?
- Unparseable date: 'Mon Aug 15 11:24:39 CST 2016',时间格式转换异常
- VC6兼容性及打开文件崩溃问题解决
- 技术人员该如何接手一个复杂的系统?
- Swiper window width changes, page width height changes lead to automatic sliding solution
猜你喜欢

Distributed consensus mechanism

OSChina 周日乱弹 —— 之前呢,我一直以为自己是个……
![[original] about the abnormal situation of high version poi autosizecolumn method](/img/3b/00bc81122d330c9d59909994e61027.jpg)
[original] about the abnormal situation of high version poi autosizecolumn method

iOS 学习笔记二【cocopods安装使用和安装过程中遇到的问题及解决办法】【20160725更新】

Is blazor ready to serve the enterprise?
![IOS learning note 2 [problems and solutions encountered during the installation and use of cocopods] [update 20160725]](/img/3b/00bc81122d330c9d59909994e61027.jpg)
IOS learning note 2 [problems and solutions encountered during the installation and use of cocopods] [update 20160725]

Blazor 准备好为企业服务了吗?

ts流中的pcr与pts计算与逆运算

面部识别:攻击类型和反欺骗技术

These core technology of object-oriented, after you master it, you can have a good interview
随机推荐
16. File transfer protocol, vsftpd service
[solution] distributed timing task solution
来自不同行业领域的50多个对象检测数据集
C / C + + Programming Notes: what are the advantages of C compared with other programming languages?
Basic operation of database
VC6兼容性及打开文件崩溃问题解决
将“光头”识别为“足球”,AI 摄像头如何犯的错?
面部识别:攻击类型和反欺骗技术
学习Scala IF…ELSE 语句
[original] about the abnormal situation of high version poi autosizecolumn method
Face recognition: attack types and anti spoofing techniques
京淘项目知识点总结
5g + Ar out of the circle, China Mobile Migu becomes the whole process strategic partner of the 33rd China Film Golden Rooster Award
LadonGo开源全平台渗透扫描器框架
Six key points of data science interview
解决RabbitMQ消息丢失与重复消费问题
iOS 学习笔记二【cocopods安装使用和安装过程中遇到的问题及解决办法】【20160725更新】
16.文件传输协议、vsftpd服务
About the promotion of the whole stack of engineers, from the introduction to give up the secret arts, do not click in to have a look?
到底选openstack还是vmware?