![](https://img-blog.csdnimg.cn/20201014180756913.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
python入门
applepies000
这个作者很懒,什么都没留下…
展开
-
python入门-字符串
大小写转换 x=[i.upper() if(i.islower()) else i.lower() for i in s] print("".join(x)) 或者是 s.swapcase() Split and Join Sample Input: this is a string Sample Output: this-is-a-string def sp原创 2017-12-25 21:31:17 · 228 阅读 · 0 评论 -
python入门-set
set不包含相同的元素, 定义 >> myset = {1, 2} # Directly assigning values to a set >> myset = set() # Initializing a set >> myset = set(['a', 'b']) # Creating a set from a list >> myset {'a', 'b'} >> myset.原创 2018-01-16 21:53:26 · 185 阅读 · 0 评论