Python3学习笔记

简介: Python3学习笔记

实例(Python 3.0+)

#!/usr/bin/python3a = "Hello"b = "Python"print("a + b 输出结果:", a + b)print("a * 2 输出结果:", a * 2)print("a[1] 输出结果:", a[1])print("a[1:4] 输出结果:", a[1:4])if("H"ina) :     print("H 在变量 a 中")else :     print("H 不在变量 a 中")if("M"notina) :     print("M 不在变量 a 中")else :     print("M 在变量 a 中")print(r'\n')print(R'\n')

以上实例输出结果为:

a + b 输出结果:HelloPython

a *2输出结果:HelloHello

a[1]输出结果: e

a[1:4]输出结果: ell

H 在变量 a

M 不在变量 a

\n

\n

相关文章
|
20天前
|
存储 C语言 Python
【Python】学习笔记day3
【Python】学习笔记day3
26 1
|
4月前
|
SQL 分布式计算 大数据
Python+大数据学习笔记(一)
Python+大数据学习笔记(一)
43 0
|
2天前
|
Python
基于Django的Python应用—学习笔记—功能完善
基于Django的Python应用—学习笔记—功能完善
|
20天前
|
存储 C语言 芯片
【Python】学习笔记day1
【Python】学习笔记day1
33 1
|
27天前
|
算法 搜索推荐 测试技术
python排序算法及优化学习笔记1
python实现的简单的排序算法,以及算法优化,学习笔记1
33 1
|
6月前
|
jenkins 持续交付 开发工具
Python学习笔记_Devops_Day05
Python学习笔记_Devops_Day05
|
6月前
|
持续交付 开发工具 数据安全/隐私保护
Python学习笔记_Devops_Day04
Python学习笔记_Devops_Day04
|
6月前
|
JSON JavaScript 前端开发
Python学习笔记_Devops_Day02
Python学习笔记_Devops_Day02
|
6月前
|
SQL 关系型数据库 数据库
Python学习笔记_Day09
Python学习笔记_Day09
|
6月前
|
Python
Python学习笔记_Day08
Python学习笔记_Day08