Python
静静燃烧的雪
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
Python 字典与集合
Python 字典字典/键值对集合/关联数组/映射/散列表 字典以什么顺序存储并不重要。重要的是解释器能够快速地访问与一个键关联的值。好消息是解释器确实可以做到这一点,这要归功于字典使用了高度优化的散列算法。 """01:Python中无 “++”与“--”功能""" >>> person = {'Name':'theName','Gende...原创 2018-07-23 10:08:27 · 662 阅读 · 0 评论 -
Python 学习笔记:时间处理
'''01:通过print()函数在控制台打印字符串02:通过type()函数获取数据的类型03:通过str()把某一数据转化成字符串04:通过<class 'datetime.datetime'>获取获取当前时间相关的数据05:通过三个单引号或者三个双引号添加多行注释,或者通过#号添加单行注释。'''# 控制台打印。print ("Hello World!") #...原创 2018-07-22 13:35:58 · 302 阅读 · 0 评论 -
Python time.sleep() 阻塞指定秒杀 random.randint()返回指定闭区间内的随机数
'''01:通过time.sleep()阻塞线程若干秒02:通过type()函数获取数据的类型03:通过random.randint()方法生成指定返回区间内的一个随机数(闭区间)04:通过int()函数把字符串转化为整数'''import random #randint()函数。import time #sleep()函数 。def testFUnction(): ...原创 2018-07-22 14:31:48 · 8622 阅读 · 0 评论 -
Python 通过range初始化list set 等
"""01:range()函数调查02:通过help()函数调查range()函数功能03:Python中的转义字符04:使用start、step、stop的方式尝试初始化list、tuple、set等05:使用len()获取list、set、tuple的长度"""help(range)tempRange = range(1,100,2)print("type(tempRang...原创 2018-07-22 15:50:36 · 2168 阅读 · 0 评论 -
Python len() list pop() append() insert() remove() copy()
world = "0123456789"worldList = list(world)# 打印数组,猜测打印一个变量X,就相当于打印str(X),而str(X)猜测相当于对X发送一个消息,X返回对自己的描述print(worldList)print(str(worldList))length = len(world)print("数组的长度: " + str(length))ch...原创 2018-07-22 20:31:41 · 789 阅读 · 0 评论 -
Python 之 str
import this # Python之禅'''Beautiful is better than ugly.Explicit is better than implicit.Simple is better than complex.Complex is better than complicated.Flat is better than nested.Sparse is be...原创 2018-07-22 21:19:16 · 2172 阅读 · 0 评论 -
Python list排序
print(3/2) # 此处与C有一定区别,c中两个整数相除结果也是整数print("type(3/2) " + str(type(3/2))) # type(3/2)<class 'float'>print(3.0/2)print("type(3.0/2) " + str(type(3.0/2))) # type(3.0/2) <class 'float'>...原创 2018-07-22 21:45:33 · 427 阅读 · 0 评论 -
Python 数组求和 求最小值 数组排序 翻转 逆序排序
# Python中缩进规则print(1)# print(2) # 无原因的缩进 unexpected idented#for i in range(5):#print(123) #for循环下面的一行如果没有缩进,则会有expected an indented block# List中相关方法# 通过start、stop、step的模式输出列表中的数据numlist ...原创 2018-07-22 22:43:21 · 2927 阅读 · 0 评论
分享