当前位置:网站首页>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]所创,转载请带上原文链接,感谢
边栏推荐
- What details does C + + improve on the basis of C
- Qt混合Python开发技术:Python介绍、混合过程和Demo
- python 循环区分(while循环和for循环)
- How can a technician take over a complex system?
- C language I blog assignment 03
- Astra: the future of Apache Cassandra is cloud native
- Data structure and sorting algorithm
- scala 中 Future 的简单使用
- The software in your host has terminated an established connection. resolvent
- Seven features of Python 3.9
猜你喜欢

Go sending pin and email

Swiper window width changes, page width height changes lead to automatic sliding solution
![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]

麦格理银行借助DataStax Enterprise (DSE) 驱动数字化转型

Oschina plays on Sunday - before that, I always thought I was a

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?

The road of cloud computing: a free AWS cloud server

laravel8更新之速率限制改进

These core technology of object-oriented, after you master it, you can have a good interview

PCR and PTS calculation and inverse operation in TS stream
随机推荐
面部识别:攻击类型和反欺骗技术
swiper 窗口宽度变化,页面宽度高度变化 导致自动滑动 解决方案
Face recognition: attack types and anti spoofing techniques
Do you really understand the high concurrency?
Learn Scala if Else statement
Wechat nickname Emoji expression, special expression causes the list not to be displayed, export excel error report and other problems solved!
来自不同行业领域的50多个对象检测数据集
Astra: Apache Cassandra的未来是云原生
Lay UI left tree Dtree right list table
1.深入Istio:Sidecar自动注入如何实现的?
Face recognition: attack types and anti spoofing techniques
golang 匿名结构体成员,具名结构体成员,继承,组合
C/C++编程笔记:C语言相比其他编程语言,有什么不一样的优势?
QT hybrid Python development technology: Python introduction, hybrid process and demo
双向LSTM在时间序列异常值检测的应用
Tail delivery
GET,POST,PUT,DELETE,OPTIONS用法与说明
nvm
SQL Server 2008R2 18456错误解决方案
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)