摘要: 类 1 类的定义 三要素: 类名、属性、方法 class 类名(): def __int__(self,参数):#初始化属性 def func1(self): def func2(self): ...#定义方法 类名主要要有实际意义,驼峰命名之类的 1.1 类的属性 def __init__(sel 阅读全文
posted @ 2021-03-29 22:18 七铭的魔法师 阅读(104) 评论(0) 推荐(0) 编辑
摘要: 函数 1 函数的定义及调用 定义: def 函数名(形参): 函数体 return 返回值#可有可无,不填默认返回none 和C++一样,有主函数:(我之前一直还以为没有来着,,,) 调用 函数名(实参) 2 参数的传递 2.1 一般的传递 位置参数 没设置默认参数时,按照位置关系一一对应,和C++ 阅读全文
posted @ 2021-03-29 22:16 七铭的魔法师 阅读(47) 评论(0) 推荐(0) 编辑
摘要: #include<bits/stdc++.h> using namespace std; #define IOS ios::sync_with_stdio(0);cin.tie(0);cout.tie(0); typedef long long ll; typedef unsigned long l 阅读全文
posted @ 2021-03-29 22:14 七铭的魔法师 阅读(35) 评论(0) 推荐(0) 编辑
摘要: 好久没写博客了== #include<bits/stdc++.h> using namespace std; #define IOS ios::sync_with_stdio(0);cin.tie(0);cout.tie(0); typedef long long ll; typedef unsig 阅读全文
posted @ 2021-03-29 22:12 七铭的魔法师 阅读(69) 评论(0) 推荐(0) 编辑