类继承

class a: def __init__(self, name): self.name=name class b: def __init__(self, p1, p2): self.p1=p1 self.p2=p2 class c(a,b): def __i

iohannes iohannes Published on 2025-03-17

类型注解

类型注解 自python3.5开始,PEP484为python引入了类型注解(type hints)。类型检查,防止运行时出现参数和返回值类型、变量类型不符合。作为开发文

iohannes iohannes Published on 2025-03-17

类的常见函数

class Person(): #创建一个类 def __init__(self): print('这是一个初始化方法。') def comm_fun(self): print('这是一个普通方法。') @staticme

iohannes iohannes Published on 2025-03-17

历史上经济萧条分析

美国历史上经济萧条前,信号预示 哪些商品首先销量大跌 在美国历史上经&

iohannes iohannes Published on 2025-03-17

历史上战争对经济的影响

世界历史上,战争爆发前,经济发展 哪些商品销量大跌 战争爆发前,通常有&

iohannes iohannes Published on 2025-03-17

马尔科夫链

https://www.cnblogs.com/pinard/p/6632399.html

iohannes iohannes Published on 2025-03-17

冒泡排序与快速排序比较

冒泡排序 冒泡排序是一种简单的排序方法,它的基本思想是:通过相邻两个元素之间的比较和交换,使较大的元素逐渐从前面ĸ

iohannes iohannes Published on 2025-03-17

枚举

from enum import Enum # pip install enum34 class Build(Enum): debug = 200 build = 400 string to enum a=Build[‘debug’] output: ‘400’ enum to s

iohannes iohannes Published on 2025-03-17

蒙特卡罗

https://www.cnblogs.com/pinard/p/6625739.html

iohannes iohannes Published on 2025-03-17

排序

map 排序 map_xxx ={} map_xxx[1] ='a' map_xxx[3] = 'c' map_xxx[2] = 'b' for k, v in map_xxx.items(): print(k) result = sorted(map_xxx.keys()) result

iohannes iohannes Published on 2025-03-17
Previous Next