GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing github.com — leetcode/python/709_To_Lower_Case.py at master · qiyuangong/leetcode Expand file tree/ Copy path709_To_Lower_Case.pyMore file actions 17 lines (16 loc) · 440 Bytes / Copy path709_To_Lower_Case.pyFile metadata and controls17 lines (16 loc) · 440 Bytes 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 class Solution(object): def toLowerCase(self, str): """ :type str: str :rtype: str """ res = [] gap = ord('a') - ord('A') for c in str: if ord(c) >= ord('A') and ord(c) <= ord('Z'): res.append(chr(ord(c) + gap)) else: res.append(c) return ''.join(res) # def toLowerCase(self, str): # return str.lower() |
| You are visitor 01402792 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |