2019年4月25日

python字符串处理内置方法一览表

摘要: python字符串处理内置方法一览表 序号方法及描述 1 capitalize()将字符串的第一个字符转换为大写 2 center(width, fillchar) 返回一个指定的宽度 width 居中的字符串,fillchar 为填充的字符,默认为空格。 3 count(str, beg= 0,e 阅读全文

posted @ 2019-04-25 21:12 冬天里暖阳 阅读(207) 评论(0) 推荐(0) 编辑

leetcode 字谜

摘要: 242. Valid Anagram Easy 66298FavoriteShare 242. Valid Anagram Easy 66298FavoriteShare Easy Given two strings s and t , write a function to determine i 阅读全文

posted @ 2019-04-25 21:00 冬天里暖阳 阅读(151) 评论(0) 推荐(0) 编辑

python 从大到小排序

摘要: a = [3,7,4,9]a = sorted(a,reverse=True)print(a)#[9, 7, 4, 3] 阅读全文

posted @ 2019-04-25 16:51 冬天里暖阳 阅读(2746) 评论(0) 推荐(0) 编辑

leetcode 最大不重复字符

摘要: class Solution: def lengthOfLongestSubstring(self, s: str) -> int: if len(s) <= 1: return len(s) d = set(s) s = list(s) dic = {} exit1 = [] ma = 1 n = 阅读全文

posted @ 2019-04-25 14:28 冬天里暖阳 阅读(193) 评论(0) 推荐(0) 编辑

导航