fork download
  1. def reverse_sort(strings):
  2. return sorted(strings, key=lambda x: x[::-1])
  3.  
  4. # 輸入
  5. input_string = "apple btc python"
  6. input_list = input_string.split()
  7.  
  8. # 排序並輸出
  9. sorted_list = reverse_sort(input_list)
  10. print(sorted_list)
  11.  
Success #stdin #stdout 0.03s 9536KB
stdin
Standard input is empty
stdout
['btc', 'apple', 'python']