python 转义字符
来源:互联网 发布:淘宝客广告语 编辑:程序博客网 时间:2024/05/18 06:20
python中的转义字符如下:
1》其中,续行符的使用举例如下:
>>> s='love p\ #续行符在行尾
... ython!'
>>> s
'love python!'
2》\ooo表示八进制数ooo代表的字符
\xXX表示十六进制数字XX表示的字符
python3代码:
s='\101\t\x41\n'
ss='\141\t\x61\n'
print ('1234567890123456')
print (s,ss)
运行结果:
3》 \" 表示双引号
>>> s='abc\"cba'
>>> s
'abc"cba'
(完)
1 0
- Python转义字符
- Python转义字符
- Python转义字符
- python转义字符
- python 转义字符
- Python转义字符
- Python转义字符
- 初学python转义字符
- python中的转义字符
- Python转义字符
- python 转义字符
- Python转义字符
- python中的转义字符
- Python转义字符
- Python转义字符
- Python转义字符
- Python转义字符
- python 转义字符
- 设计模式 工厂模式 从卖肉夹馍说起
- 取随机数的方法
- OJ提交题目中的语言选项里G++与C++的区别
- poi中常用的api
- AsyncTask学习笔记
- python 转义字符
- C#实现语音聊天之DirectX方法
- 【sql查询与优化】5.使用字符串
- Spark安装与学习
- mysql数据类型详解
- Build Your First Mobile App With Ionic 2 & Angular 2 - Part 2
- OpenCV学习HighGUI
- 【华为OJ】【096-表达式求值】
- java学习笔记5.22多维数组以及对象和类