摘要: leetcode-59题 leetcode-59题 参考代码随想录的中的解题思路 class Solution: def generateMatrix(self, n: int) -> List[List[int]]: x,y=0,0 loop=n//2 temp=1 matrix = [[0] * 阅读全文
posted @ 2022-06-07 16:28 someonezero 阅读(29) 评论(0) 推荐(0) 编辑
摘要: self的使用,当创建了类的时候,要将self参数写入,在使用该函数的时候,需要先将其实例化才能使用 类方法需要使用self参数,而普通方法不需要self参数 1、self是指自己的意思,是指实例对象自己,也就是s1 = Student(‘张三’,80) 中的"s1"。 2、使用self的意义是把n 阅读全文
posted @ 2022-06-07 11:19 someonezero 阅读(211) 评论(0) 推荐(0) 编辑