Python - Function to reverse strings in LIST

后端 未结 2 956
误落风尘
误落风尘 2021-01-29 06:09

studying Python as crazy and have many many questions.

This time about function, i need to create 2 functions, first for numbers to sum up everything that user inputs in

2条回答
  •  轮回少年
    2021-01-29 06:51

    For your first function, that already exists as a built-in function of same name (sum()). For the second, you can use a simple list comprehension.

    def rever(strings):
        return [x[::-1] for x in strings]
    

提交回复
热议问题