Commit 833dec2e by BellCodeEditor

auto save

parent 4b8ba18c
Showing with 24 additions and 38 deletions
class Dog: # 狗类 import turtle
def __init__(self): turtle.penup()
self.footNum = 4 # 腿 turtle.goto(0,-150)
self.eyeNum = 2 # 眼睛 turtle.pendown()
self.head = 1 # 头 turtle.fillcolor("yellow")
self.earsNum = 2 # 耳朵 turtle.pencolor("yellow")
self.skin = "white" turtle.begin_fill()
turtle.circle(150)
def run(self): turtle.end_fill()
print("狗狗飞快的跑起来") turtle.penup()
turtle.goto(150,-75)
turtle.pendown()
class Husky(Dog): # 哈士奇类 turtle.pencolor("white")
def __init__(self): turtle.fillcolor("white")
super().__init__() turtle.begin_fill()
self.skin='black' turtle.circle(75)
self.earsNum=1 turtle.end_fill()
coco = Husky() turtle.done()
coco.run() \ No newline at end of file
\ No newline at end of file
class Dog: # 狗类 a = int(input("请输入长方形的长"))
def __init__(self): b = int(input("请输入长方形的宽"))
self.footNum = 4 # 腿 c = a*b
self.eyeNum = 2 # 眼睛 print("长方形的面积是"+str(c))
self.head = 1 # 头 \ No newline at end of file
self.earsNum = 2 # 耳朵
self.skin = "white"
def run(self):
print("狗狗飞快的跑起来")
class Husky(Dog): # 哈士奇类
def __init__(self):
coco = Husky()
print(coco.head)
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment