当前位置:网站首页>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]所创,转载请带上原文链接,感谢
边栏推荐
- shiyou的数值分析作业
- QT hybrid Python development technology: Python introduction, hybrid process and demo
- Summary of knowledge points of Jingtao project
- Interface
- 来自不同行业领域的50多个对象检测数据集
- swiper 窗口宽度变化,页面宽度高度变化 导致自动滑动 解决方案
- Basic operation of database
- Six key points of data science interview
- FORTRAN77从文件中读入若干数据并用heron迭代公式开方
- 【总结系列】互联网服务端技术体系:高性能之数据库索引
猜你喜欢

PCR and PTS calculation and inverse operation in TS stream
![[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

洞察——风格注意力网络(SANet)在任意风格迁移中的应用

个人短网址生成平台 自定义域名、开启防红、统计访问量

微信昵称emoji表情,特殊表情导致列表不显示,导出EXCEL报错等问题解决!

QT hybrid Python development technology: Python introduction, hybrid process and demo

Daily challenges of search engines_ 4_ External heterogeneous resources - Zhihu

Goland 编写含有template的程序

5g + Ar out of the circle, China Mobile Migu becomes the whole process strategic partner of the 33rd China Film Golden Rooster Award

Fortify漏洞之 Privacy Violation(隐私泄露)和 Null Dereference(空指针异常)
随机推荐
Brief history of computer
Adobe Prelude / PL 2020 software installation package (with installation tutorial)
学习Scala IF…ELSE 语句
wanxin金融
Tail delivery
C++在C的基础上改进了哪些细节
A compilation bug brought by vs2015 Update1 update [existing solutions]
Qt混合Python开发技术:Python介绍、混合过程和Demo
Learn Scala if Else statement
ts流中的pcr与pts计算与逆运算
面部识别:攻击类型和反欺骗技术
More than 50 object detection datasets from different industries
Daily challenges of search engines_ 4_ External heterogeneous resources - Zhihu
Privacy violation and null dereference of fortify vulnerability
1.深入Istio:Sidecar自动注入如何实现的?
Abnormal + Abstract
OSChina 周日乱弹 —— 之前呢,我一直以为自己是个……
Fortify漏洞之 Privacy Violation(隐私泄露)和 Null Dereference(空指针异常)
Python3.9的7个特性
1. In depth istio: how is sidecar auto injection realized?