The goal of this code is to draw a smiley face and be able to change emotion, mouth and eyes.
Use the demo code below to fill in the blanks ( ), as well as add any other methods or data that is needed. All blanks should be completed with a single line of code (or partial line). You should not modify any other code that exists. Only remove the blanks and add other missing methods.
Use a radius of 100 for the head. The mouth is a thicker line. The face is centered at 0, 0.
DEMO CODE:
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):
def is_happy(self):
def is_dark_eyes(self):
def change_mouth(self):
self.draw_face()
def change_emotion(self):
self.draw_face()
def change_eyes(self):
self.draw_face()
def main():
face =
face.
done = False
while not done:
print("Change My Face")
mouth = "frown" "smile"
emotion = "angry" "happy"
eyes = "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:
elif menu == 2:
elif menu == 3:
else:
break
print("Thanks for Playing")
turtle.hideturtle()
turtle.done()
main()
The goal of this code is to draw a smiley face and be able to change emotion, mouth and eyes. Use...
I have to write a program where the program prints a deck of
cards. instead of having your regular suits and numbers the program
will use a value for a number, id will be either rock, paper, or
scissors, and the coin will be heads or tails. print example: 2 of
rock heads. If the user is enters 1 the program will print out 30
of the print example and arrange them by there values. if the user
enters 2...
PYTHON. Continues off another code(other code is below). I don't understand this. Someone please help! Comment the lines please so I can understand. There are short and med files lengths for each the list of names/ids and then search id file. These are the input files: https://codeshare.io/aVQd46 https://codeshare.io/5M3XnR https://codeshare.io/2W684E https://codeshare.io/5RJwZ4 LinkedList ADT to store student records(code is below). Using LinkedList ADT instead of the Python List. You will need to use the Student ADT(code is below) Imports the Student class...
PYTHON. Continues off another code. I don't understand this. Someone please help! Comment the lines please so I can understand LinkedList ADT: class myLinkedList: def __init__(self): self.__head = None self.__tail = None self.__size = 0 def insert(self, i, data): if self.isEmpty(): self.__head = listNode(data) self.__tail = self.__head elif i <= 0: self.__head = listNode(data, self.__head) elif i >= self.__size: self.__tail.setNext(listNode(data)) self.__tail = self.__tail.getNext() else: current = self.__getIthNode(i - 1) current.setNext(listNode(data,...
Can you add code comments where required throughout this Python Program, Guess My Number Program, and describe this program as if you were presenting it to the class. What it does and everything step by step. import random def menu(): #function for getting the user input on what he wants to do print("\n\n1. You guess the number\n2. You type a number and see if the computer can guess it\n3. Exit") while True: #using try-except for the choice will handle the...
PYTHON The provided code in the ATM program is incomplete. Complete the run method of the ATM class. The program should display a message that the police will be called after a user has had three successive failures. The program should also shut down the bank when this happens. [comment]: <> (The ATM program allows a user an indefinite number of attempts to log in. Fix the program so that it displays a message that the police will be called...
how
to make my code of python work probely
my q is how to write a code to find the average actual water
level, average error by using python
and my program should be flexible where user can select the
column no. If you can see in the main program, it asked which
column to know the maximum or average, the column number is passed
to the function. The function should look which column to do.
#THIS PROGRAMMING IS ABLE...
Zybooks 11.12 LAB*: Program: Online shopping cart (continued) Python 3 is the code needed and this is in Zybooks Existing Code # Type code for classes here class ItemToPurchase: def __init__(self, item_name="none", item_price=0, item_quantity=0): self.item_name = item_name self.item_price = item_price self.item_quantity = item_quantity # def __mul__(self): # print_item_cost = (self.item_quantity * self.item_price) # return '{} {} @ ${} = ${}' .format(self_item_name, self.item_quantity, self.item_price, print_item_cost) def print_item_cost(self): self.print_cost = (self.item_quantity * self.item_price) print(('{} {} @ ${} = ${}') .format(self.item_name, self.item_quantity, self.item_price,...
For my computer class I have to create a program that deals with
making and searching tweets. I am done with the program but keep
getting the error below when I try the first option in the shell.
Can someone please explain this error and show me how to fix it in
my code below? Thanks!
twitter.py - C:/Users/Owner/AppData/Local/Programs/Python/Python38/twitter.py (3.8.3) File Edit Format Run Options Window Help import pickle as pk from Tweet import Tweet import os def show menu():...
Need help finishing this code # Description : The Pet class contains fields for name, pet # type,and age. The age field is the age now # or age of pet when it passed away. (These # are all dogs I have had.) There is a static or # class variable called number_pets that # tracks how many instances have been created. # The constructor will fill all fields and add # one to the number_pets variable. # The special...