题解 | #字符串变形#
字符串变形
https://www.nowcoder.com/practice/c3120c1c1bc44ad986259c0cf0f0b80e
class Solution: def trans(self , s: str, n: int) -> str: # write code here nums = [i.swapcase() for i in s.split(' ')[::-1]] return ' '.join(nums)使用swapcase函数进行大小写转换
#刷题##牛客求职必刷题#