码迷,mamicode.com
首页 > 编程语言 > 详细

python-day8-赋值

时间:2017-07-20 19:43:29      阅读:114      评论:0      收藏:0      [点我收藏+]

标签:hello   pytho   key   int   print   python   解压   赋值   链式   

# x=10

#链式赋值
# a=b=c=d=e=f=10
# print(a,b,c,d,e,f)

#增量赋值

# x=10
# y=‘a‘
# temp=x
# x=y
# y=temp
# print(x,y)

# x,y=y,x
# print(x,y)


#值的解压
# msg=‘hello‘
# l=[1,2,3]

# a,b,c,d,e=msg
# print(a,b,c,d,e)

# a,_,_,_,e=msg
# a,*_,e=msg
# print(a)
# print(e)



# dic={‘a‘:1,‘b‘:2,‘c‘:3}
# x,y,z=dic
# print(x,y,z) # x y z d取得是key

python-day8-赋值

标签:hello   pytho   key   int   print   python   解压   赋值   链式   

原文地址:http://www.cnblogs.com/liuwei0824/p/7213874.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!