摘要: 随机整数生成类 import randomclass RandomGen: def generate(self,start=1,stop=100,count=10): return [random.randint(start,stop) for x in range(count)]a = Rando 阅读全文
posted @ 2021-01-05 23:18 gaojiawei 阅读(139) 评论(0) 推荐(0)
摘要: class Point: def __init__(self,x,y): self.x = x self.y = y def __str__(self): return "Point({},{})".format(self.x,self.y) def __repr__(self): return " 阅读全文
posted @ 2021-01-04 22:34 gaojiawei 阅读(93) 评论(0) 推荐(0)