当前位置:网站首页>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]所创,转载请带上原文链接,感谢
边栏推荐
- Oschina plays on Sunday - before that, I always thought I was a
- Adobe Prelude /Pl 2020软件安装包(附安装教程)
- More than 50 object detection datasets from different industries
- 到底选openstack还是vmware?
- Goland 编写含有template的程序
- Problems of Android 9.0/p WebView multi process usage
- On the stock trading of leetcode
- Fortify漏洞之 Privacy Violation(隐私泄露)和 Null Dereference(空指针异常)
- iOS上传App Store报错:this action cannot be completed -22421 解决方案
- LadonGo开源全平台渗透扫描器框架
猜你喜欢
16. File transfer protocol, vsftpd service
QT hybrid Python development technology: Python introduction, hybrid process and demo
What details does C + + improve on the basis of C
Littlest jupyterhub| 02 using nbgitpuller to distribute shared files
Wechat nickname Emoji expression, special expression causes the list not to be displayed, export excel error report and other problems solved!
Get tree menu list
SQL Server 2008R2 18456错误解决方案
Qt混合Python开发技术:Python介绍、混合过程和Demo
2020天翼智能生态博览会中国电信宣布5G SA正式规模商用
5g + Ar out of the circle, China Mobile Migu becomes the whole process strategic partner of the 33rd China Film Golden Rooster Award
随机推荐
Visual Studio 2015 未响应/已停止工作的问题解决
Wanxin Finance
China Telecom announces 5g SA commercial scale in 2020
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?
2020-11-07:已知一个正整数数组,两个数相加等于N并且一定存在,如何找到两个数相乘最小的两个数?
What? Your computer is too bad? You can handle these moves! (win10 optimization tutorial)
Do you really understand the high concurrency?
Golang anonymous structure member, named structure member, inheritance, composition
来自不同行业领域的50多个对象检测数据集
Adobe Prelude / PL 2020 software installation package (with installation tutorial)
python_scrapy_房天下
Sum up some useful functions
哔哩哔哩常用api
模板链表类学习
麦格理银行借助DataStax Enterprise (DSE) 驱动数字化转型
QT hybrid Python development technology: Python introduction, hybrid process and demo
The most detailed usage guide for perconaxtradbcluster8.0
京淘项目知识点总结
Cloud Alibabab笔记问世,全网详解仅此一份手慢无
Download, installation and configuration of Sogou input method in Ubuntu