python怎样将元组中的数据倒置
展开全部
Python 2.7.2+ (default, Oct 4 2011, 20:06:09)
[GCC 4.6.1] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> t = tuple(range(10))
>>> t
(0, 1, 2, 3, 4, 5, 6, 7, 8, 9)
>>> t = tuple(t[::-1])
>>> t
(9, 8, 7, 6, 5, 4, 3, 2, 1, 0)
>>>
[GCC 4.6.1] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> t = tuple(range(10))
>>> t
(0, 1, 2, 3, 4, 5, 6, 7, 8, 9)
>>> t = tuple(t[::-1])
>>> t
(9, 8, 7, 6, 5, 4, 3, 2, 1, 0)
>>>
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询