Python Forum

Full Version: Homework - Beginner
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I need to write a code in python using turtle to have a user input that changes the face or emotion of a smiley face. I am new to this and really have no idea where to go from here. This is what I have.
import turtle


class Face:
    def __init__(self):
        self.__smile = True
        self.__happy = True
        self.__dark_eyes = True

    def draw_face(self):
        turtle.clear()
        self.__draw_head()
        self.__draw_eyes()
        self.__draw_mouth()

    def is_smile(self):
        ___<Fill-In>___

    def is_happy(self):
        ___<Fill-In>___

    def is_dark_eyes(self):
        ___<Fill-In>___

    def change_mouth(self):
        ___<Fill-In>___
        self.draw_face()

    def change_emotion(self):
        ___<Fill-In>___
        self.draw_face()

    def change_eyes(self):
        ___<Fill-In>___
        self.draw_face()


def main():
    face = ___<Fill-In>___
    face.___<Fill-In>___

    done = False

    while not done:
        print("Change My Face")
        mouth = "frown" ____<Fill-In>___ "smile"
        emotion = "angry" ____<Fill-In>___ "happy"
        eyes = "black" if self.__dark_yes else "blue" "black"
        print("1) Make me", mouth)
        print("2) Make me", emotion)
        print("3) Make my eyes", eyes)
        print("0) Quit")

        menu = eval(input("Enter a selection: "))

        if menu == 1:
            ___<Fill-In>___
        elif menu == 2:
            ___<Fill-In>___
        elif menu == 3:
            ___<Fill-In>___
        else:
            break

    print("Thanks for Playing")

    turtle.hideturtle()
    turtle.done()


main()
I believe that's what your professor gave you. What have you tried?

Also, I believe there's someone else from your class here.