python leetcode practice(709. To Lower Case)

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了python leetcode practice(709. To Lower Case)相关的知识,希望对你有一定的参考价值。

class Solution:
    def toLowerCase(self, str):
        """
        :type str: str
        :rtype: str
        """
        output = '' 
        for c in str:
            if(ord(c) > 64 and ord(c) < 91):   # ord() transfer char to ASCII number      
                output += chr(ord(c)+32)
            else:
                output+=c
        return output
        

以上是关于python leetcode practice(709. To Lower Case)的主要内容,如果未能解决你的问题,请参考以下文章

Personal Leetcode solution(Python) 21-40

Leetcode Practice -- 字符串

LeetCode Note 1st,practice makes perfect

Leetcode Practice --- 栈和队列

Leetcode简单题41~60

python:practice renderer