edhesive 5.7 pls write the code
Answers
Answer:
import simplegui
import math
# Global Variables
width = 600
height = 600
face1 = False
face2 = False
# Event Handlers
def toggle_face1():
global face1
face1 = not face1
def toggle_face2():
global face2
face2 = not face2
def draw(canvas):
if face1:
canvas.draw_circle((width/2, height/2), width/2 - 50, 10, "Yellow", "Yellow")
canvas.draw_circle((200, 200), 45, 10, "Black", "Black")
canvas.draw_circle((400, 200), 45, 10, "Black", "Black")
canvas.draw_circle((300, 375), 130, 10, "White", "White")
canvas.draw_line((150, 280), (450, 280), 125, "Yellow")
if face2:
canvas.draw_circle((width/2, height/2), width/2 - 50, 10, "Yellow", "Yellow")
canvas.draw_circle((200, 200), 45, 10, "Black", "Black")
canvas.draw_circle((400, 200), 45, 10, "Black", "Black")
canvas.draw_circle((300, 450), 130, 7, "Black")
canvas.draw_line((166, 450), (434, 450), 100, "Yellow")
canvas.draw_circle((215, 494), 40, 7, "Yellow", "Yellow")
canvas.draw_circle((385, 494), 40, 7, "Yellow", "Yellow")
# Remember to start the frame
frame.start()
Explanation: