python 8天入门笔记
2017-11-17 20:31
288 查看
day01
day02
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
day03 字符串处理函数
引号可以是一对单引号、双引号、三引号(单/双)。
python中三引号可以将复杂的字符串进行复制:python三引号允许一个字符串跨多行,字符串可以包含换行符、制表符以及其他特殊字符。
示例:
var1='hello world' var2="hello python"
var3='''hello world''' var4="""hello python""" (三引号)
print ('hello "dear" ') (避免歧义,无需转义符)
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
python访问字符串的值
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Python字符串运算符
a="hello" b="python"
+ 字符串拼接 a+b :hello python
*重复输出字符串 a*2: hellohello
[ ] 通过索引获取字符 a[1]:e
[ : ] 截取字符串中的一部分 a[1:4] ell
in 成员运算符 'e' in a: True
not in 成员运算符 'p' not in a:False
r /R 原始字符串 print r'hello\n'
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Python字符串格式化
print ("my name is %s and weight is %d kg!" % ("zara",13))
》》》my name is zara and weight is 13 kg!
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
字符串各种函数
find
按值传参和按引用传参
卡在idel上,比如anaconda、sublime、python、ipython,准备参考书籍上进行编辑。
day02
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
day03 字符串处理函数
引号可以是一对单引号、双引号、三引号(单/双)。
python中三引号可以将复杂的字符串进行复制:python三引号允许一个字符串跨多行,字符串可以包含换行符、制表符以及其他特殊字符。
示例:
var1='hello world' var2="hello python"
var3='''hello world''' var4="""hello python""" (三引号)
print ('hello "dear" ') (避免歧义,无需转义符)
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
python访问字符串的值
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Python字符串运算符
a="hello" b="python"
+ 字符串拼接 a+b :hello python
*重复输出字符串 a*2: hellohello
[ ] 通过索引获取字符 a[1]:e
[ : ] 截取字符串中的一部分 a[1:4] ell
in 成员运算符 'e' in a: True
not in 成员运算符 'p' not in a:False
r /R 原始字符串 print r'hello\n'
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Python字符串格式化
print ("my name is %s and weight is %d kg!" % ("zara",13))
》》》my name is zara and weight is 13 kg!
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
字符串各种函数
find
按值传参和按引用传参
卡在idel上,比如anaconda、sublime、python、ipython,准备参考书籍上进行编辑。
相关文章推荐
- python入门笔记(1)
- 用Python做网页抓取与解析入门笔记(转)
- python学习笔记(二)——Pandas十分钟入门
- python学习笔记--Django入门四 管理站点
- Python 入门笔记 字典
- 一、机器学习系统设计笔记之python机器学习入门
- python 入门笔记(二)
- python入门——笔记1
- Python入门笔记(2)_ 数据类型及取整运算 round,floor,ceil
- Python爬虫入门笔记:urllib库的使用2
- python入门教程&学习笔记
- 【零基础入门学习Python笔记009】了不起的分支和循环3
- Python系列学习笔记(一)——入门学习
- python学习笔记(django入门02)
- Python 学习笔记3 - 定向爬虫入门
- 【Python】【学习笔记】1.快速入门
- [Python入门及进阶笔记]Python-基础-内置函数小结
- 编程小白的第一本 python 入门书 学习笔记05 第六章 数据结构
- 零基础入门学习Python学习笔记第五讲【列表】
- python 入门视频学习笔记+python入门视频百度云分享