Byte of Python笔记(一)
2011-11-15 11:14
627 查看
Python有三种数据类型:number,又有四种类型
integer
long integer
floating point
complex number
string
单引号'
双引号"
三引号'''或者""":三引号里面可以用单引号和双引号
class
Note:在string里面,转义字符的应用和C几乎一致。Python增加了对unicode的支持,如果要用unicode,办法很简单,在string前面加一个前缀u或者U,比如u"This is a Unicode string."string是不可以改变的,类似与C里面的conststring是可以自动连接在一起的,比如'what\'s' 'you name'会被转换成'what\'s you name'在Python里面,变量不需要像C那样先声明,再使用,而是可以直接使用
通过 Wiz 发布
integer
long integer
floating point
complex number
string
单引号'
双引号"
三引号'''或者""":三引号里面可以用单引号和双引号
class
Note:在string里面,转义字符的应用和C几乎一致。Python增加了对unicode的支持,如果要用unicode,办法很简单,在string前面加一个前缀u或者U,比如u"This is a Unicode string."string是不可以改变的,类似与C里面的conststring是可以自动连接在一起的,比如'what\'s' 'you name'会被转换成'what\'s you name'在Python里面,变量不需要像C那样先声明,再使用,而是可以直接使用
通过 Wiz 发布
相关文章推荐
- A Byte of Python 笔记(11)异常:try..except、try..finally
- A Byte of Python 笔记(5)函数:定义、形参、局部变量、默认参数、关键参数
- Byte of Python笔记(八)
- A Byte of Python 笔记(6)模块
- Byte of Python笔记(二)
- A Byte of Python 笔记(4)控制流:if、for、while、break、continue
- 【byte-of-python 学习笔记】——基础知识
- a byte of python初学笔记 001
- 《A Byte of Python》笔记
- A Byte of Python 笔记(3)运算符和表达式
- A Byte of Python 笔记(7)数据结构:列表、元组、字典,序列
- a byte of python初学笔记 002
- Byte of Python学习笔记一
- Byte of Python学习笔记八
- Byte-of-python笔记代码1:helloworld.py
- Python 学习笔记: A byte of python (一) 基础
- A Byte of Python 笔记(12)python 标准库:sys、os,更多内容
- A Byte of Python 笔记(10)输入/输出:文件和储存器
- Byte-of-python笔记代码2:module.py
- A Byte of Python 笔记(8)