怎么在海龟编辑器里面定义一个类呀?
用户:
橘生淮北则为枳查看:6 回复:7 评论:6 创建时间:2021-01-26T10:18:00
回复
上一页第 1 页 / 共 1 页下一页
极限小白class CMD()#你想是啥都行
#.....
#....
点赞1
极限小白在类里你可以用以下的方式在类中创建方法
class CMD():
def _init_(...):
#.....
点赞0
极限小白调用类的方法:
a =class CMD()
a.hell(so)#hill可以换成类中的方法,sp可以换成其他东西用于填充方法的函数
点赞0
********积木里面没有,自己定义
class …():#类首字母大写
def __init__(self,…):
self.… = …
def …(self,…):
…
点赞0
一块软糖例如:
class bianchengmao():
def mao(self):
print(cat)
app = bianchengmao()
app.mao()
点赞0