题解 | #排序与反转#

排序与反转

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)

全部评论

相关推荐

预计下个星期就能开奖吧,哪位老哥来给个准信
华孝子爱信等:对接人上周说的是这周
点赞 评论 收藏
分享
点赞 收藏 评论
分享
牛客网
牛客企业服务