您的位置:首页 > 编程语言 > Python开发

Python 混淆知识点集合

2014-12-25 22:00 375 查看
1,字符串和列表的更新异同:

  (1)均可更新

  (2)It's important to remember that lists are mutable (changeable) in Python,
but strings aren't; when you slice a string, you get back a new string. The original string is unchanged
unless you purposely "save over" it, like this:

my_string = "Monty Python"
# => Monty Python
my_string = my_string[:-7]
# => Monty
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: