半臻 半臻
4年前
Python基础3——异常
11异常11.1异常种类异常种类没必要记,不懂的话直接去百度即可AttributeError试图访问一个对象没有的属性IOError输入、输出异常ImportError无法引入模块或者包IndentationError语法错误,代码缩进问题IndexError数组越界KeyError字典中不存在的键KeyboardIn
Bill78 Bill78
4年前
python多线程详解
python中的多线程是一个非常重要的知识点,今天为大家对多线程进行详细的说明,代码中的注释有多线程的知识点还有测试用的实例。码字不易,阅读或复制完了,点个赞!importthreadingfromthreadingimportLock,Threadimporttime,os'''
Stella981 Stella981
4年前
Python code question 6
Question6Level2Question:Writeaprogramthatcalculatesandprintsthevalueaccordingtothegivenformula:QSquarerootof\(2\C\D)/H\Followingarethefix
Stella981 Stella981
4年前
Python常用算法(一)
1.选择排序不断找到最小的(找最大的也是可以的)首先拿到第一个,然后发现比它小的,记住下标。循环一轮,找到最小的数的位置和最左边的数交换位置然后从第二个开始....和第二个交换位置,循环最后变得有序codingutf8defselect_sort(list):foriin
Stella981 Stella981
4年前
Python code question 3
Question3Level1Question:Withagivenintegralnumbern,writeaprogramtogenerateadictionarythatcontains(i,i\i)suchthatisanintegralnumberbetween1andn
Stella981 Stella981
4年前
Python面向对象编程
本知识点参考廖雪峰的Python课程\https://www.liaoxuefeng.com(https://www.oschina.net/action/GoToLink?urlhttps%3A%2F%2Fwww.liaoxuefeng.com)\
Stella981 Stella981
4年前
Python数据分析
1.numpy\支持多维数组与矩阵的科学计算器包功能:常用功能16条a.ndarrayn维数组/矢量的操作。b. 支持高级大量的n维数组与矩阵的运算。c.针对数组运算提供大量的数学函数库。2.scipy\配合numpy完成对矩阵的计算,因此依赖于numpy,且含多个子模块功能:常用15个函数a. 标准导
Stella981 Stella981
4年前
Python的while else
python中有一个其独有的功能,whileelse.它的作用是判断是循环是否被终止,如果没有被终止,那么就会执行else,反之则不会执行。还是用一段代码来解释吧else被执行:count0whilecount<5:print('loop',count)count
Stella981 Stella981
4年前
Python之文件处理
Python之文件处理不同模式打开文件的完全列表:模式描述r以只读方式打开文件。文件的指针将会放在文件的开头。这是默认模式。rb以二进制格式打开一个文件用于只读。文件指针将会放在文件的开头。这是默认模式。一般用于非文本文件如图片等。r打开一个文件用于读写。文件指针将会放在文件的开头。r
Stella981 Stella981
4年前
Python实现生命游戏
1\.生命游戏是什么生命游戏是英国(https://www.oschina.net/action/GoToLink?urlhttps%3A%2F%2Fbaike.baidu.com%2Fitem%2F%25E8%258B%25B1%25E5%259B%25BD%2F144602)数学家约翰·何顿·