leetcode_709 转换成小写字母

127 阅读1分钟

要求

给你一个字符串 s ,将该字符串中的大写字母转换成相同的小写字母,返回新的字符串。

示例 1:

输入:s = "Hello"
输出:"hello"

示例 2:

输入:s = "here"
输出:"here"

示例 3:

输入:s = "LOVELY"
输出:"lovely"

核心代码

class Solution:
    def toLowerCase(self, s: str) -> str:
        return s.lower()

image.png

解题思路:作弊法,直接使用python已经存在的库函数进行处理。