Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Homework - Beginner
#1
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()
Reply
#2
I believe that's what your professor gave you. What have you tried?

Also, I believe there's someone else from your class here.
Craig "Ichabod" O'Brien - xenomind.com
I wish you happiness.
Recommended Tutorials: BBCode, functions, classes, text adventures
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Beginner Python Homework Question (Calculate Gross Pay) matchamochi7 4 5,732 Nov-02-2018, 01:06 PM
Last Post: buran

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020