题解 | #排序与反转#

排序与反转

https://www.nowcoder.com/practice/b469ae9eb1b74c029aca052286718938

my_list = ['P','y','t','h','o','n']
print('Here is the original list:')
print(my_list)
print()
print('The result of a temporary reverse order:')
print(sorted(my_list,reverse=True))
print()
print('Here is the original list again:')
print(my_list)
print()
my_list.sort(reverse=True)
#print(my_list)
#print()
print('The list was changed to:')
print(my_list)
print()
my_list.reverse()
print('The list was changed to:')
print(my_list)

全部评论

相关推荐

有工作后先养猫:太好了,是超时空战警,我们有救了😋
点赞 评论 收藏
分享
点赞 收藏 评论
分享
牛客网
牛客企业服务