python自学笔记
来自简明python教程
数字
整形 int
浮点型 float
字符串
一串字符串(string)是字符(Characters)的序列(Sequence)
单引号
双引号
三引号
字符串是不可变的
格式化方法format()
age = 20
name = 'Swaroop'
print('{0} was {1} years old when he wrote this book'.format(name, age))
print('Why is {0} playing with that python?'.format(name))
输出
Swaroop was 20 years old when he wrote this book
Why is Swaroop playing with that python?
转意序列
/
原始字符串
r. R