Docsity

CodeHs 2.16.4 Happy Face, Cheat Sheet of Computer science

Toggle sidebar
bg1
speed(0)
penup()
def yellow_circle():
setposition(0,-100)
color("yellow")
pendown()
begin_fill()
circle(100)
end_fill()
penup()
def smile():
setposition(-75,10)
right(90)
pendown()
color("black")
pensize(10)
circle(75,180)
penup()
def eyes():
setposition(-30,40)
right(90)
begin_fill()
circle(10)
end_fill()
penup()
forward(60)
begin_fill()
circle(10)
end_fill()
def draw_smiley():
yellow_circle()
smile()
eyes()
happy = input("Are you happy?(Yes/No) ")
if happy == "Yes":
draw_smiley()
Discount

On special offer

Partial preview of the text

Download CodeHs 2.16.4 Happy Face and more Cheat Sheet Computer science in PDF only on Docsity!

speed(0) penup() def yellow_circle(): setposition(0,-100) color("yellow") pendown() begin_fill() circle(100) end_fill() penup() def smile(): setposition(-75,10) right(90) pendown() color("black") pensize(10) circle(75,180) penup() def eyes(): setposition(-30,40) right(90) begin_fill() circle(10) end_fill() penup() forward(60) begin_fill() circle(10) end_fill() def draw_smiley(): yellow_circle() smile() eyes() happy = input("Are you happy?(Yes/No) ") if happy == "Yes": draw_smiley()