美文网首页
2019-08-08

2019-08-08

作者: 小鱼儿spr | 来源:发表于2019-08-08 15:59 被阅读0次

spam = 'Spam'

Basic form

spam, ham = 'yum', 'YUM'

Tuple assignment (positional)

[spam, ham] = ['yum', 'YUM']

List assignment (positional)

a, b, c, d = 'spam'

Sequence assignment, generalized

a, *b = 'spam'

Extended sequence unpacking (Python 3.X)

spam = ham = 'lunch'

Multiple-target assignment

spams += 42

Augmented assignment (equivalent to spams = spams + 42)

相关文章

网友评论

      本文标题:2019-08-08

      本文链接:https://www.haomeiwen.com/subject/vyixjctx.html