python学习笔记 程序执行过程 基本数据类型

python一切皆对象。

列表的元素可以修改,元组的不能修改。

# python2.7
name = 'The world is like a mirror: when you frown at it, it frowns at you; when smile, it smiles too.  '
print name[0:2]
print name[10:]

print name[1:2:2]

切片重新创建新对象

a = raw_input('please input sth:')
print(a)

猜你喜欢

转载自blog.csdn.net/moonlightpeng/article/details/84403528
今日推荐