Question

Betty B. is writing a script for her animation. She chose Python as she has heard...

Betty B. is writing a script for her animation. She chose Python as she has heard it's an easy language to use but is already having difficulties. Can you help her with her code? What is her problem and how can you fix it?

def AnimationCharacter():
    def __init__(self, name):
        self.name = name
        
class Gupty(AnimationCharacter):
    def __init__(self):
        super().__init__("Gupty")
        
class Roland(AnimationCharacter):
    def __init__(self):
        super().__init__("Roland Rabbit")
0 0
Add a comment Improve this question Transcribed image text
Answer #1

Fixed part is Highlighted : It is an example of inheritence in python and this is how you do it.It should be class not def

CODE :

class AnimationCharacter():
def __init__(self, name):
self.name = name
  
class Gupty(AnimationCharacter):
def __init__(self):
super().__init__("Gupty")
  
class Roland(AnimationCharacter):
def __init__(self):
super().__init__("Roland Rabbit")

Add a comment
Know the answer?
Add Answer to:
Betty B. is writing a script for her animation. She chose Python as she has heard...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • PYTHON: Conan is writing a module to contain different implementations of trees. After his first tree,...

    PYTHON: Conan is writing a module to contain different implementations of trees. After his first tree, the BinaryTreeclass, he wrote test code and is having problems understanding the error. Locate his problem and explain how you would fix it. class Node(object): def __init__(self, data=None): self.data = data def __str__(self): return "NODE: " + str(self.data)    class Tree(object): def __init__(self): self.root_node = None self.size = 0    def __len__(self): return self.size    def add(self, data): raise NotImplementedError("Add method not implemented.")    def inorder_traversal(self): raise NotImplementedError("inorder_traversal...

  • Intro to Python: Q1: Bonnie is writing a Python program for her math class so she can check her answers quickly. She is...

    Intro to Python: Q1: Bonnie is writing a Python program for her math class so she can check her answers quickly. She is having some difficulties, however, because when she enters values like 3.5 or 2.71 her program throws an error. She has heard of your expertise in Python and asks for your help. What error is being thrown and how can she fix the program to accept values like 3.5 or 2.71? from math import sgrt def distance (coorl,...

  • Intro to python: Billy is writing a small script to save names he enters in to...

    Intro to python: Billy is writing a small script to save names he enters in to a file using a specified separator. He reads in names until the user enters an exclamation point indicating the end of the list of names at which point it writes the list to a file. Billy, however, is getting a strange error and isn't sure about how to fix the issue. Describe what is the error and how can you fix it? def write_list_to_file(file_path,...

  • If the employee is a supervisor calculate her paycheck as her yearly salary / 52 (weekly...

    If the employee is a supervisor calculate her paycheck as her yearly salary / 52 (weekly pay) If the employee is not a supervisor and she worked 40 hours or less calculate her paycheck as her hourly wage * hours worked (regular pay) If the employee is not a supervisor and worked more than 40 hours calculate her paycheck as her (hourly wage * 40 ) + (1 ½ times here hourly wage * her hours worked over 40) (overtime...

  • PYTHON The provided code in the ATM program is incomplete. Complete the run method of 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...

  • You need not run Python programs on a computer in solving the following problems. Place your...

    You need not run Python programs on a computer in solving the following problems. Place your answers into separate "text" files using the names indicated on each problem. Please create your text files using the same text editor that you use for your .py files. Answer submitted in another file format such as .doc, .pages, .rtf, or.pdf will lose least one point per problem! [1] 3 points Use file math.txt What is the precise output from the following code? bar...

  • Evaluate the arical writ the response in which you state your agreement or disagreement with writer...

    Evaluate the arical writ the response in which you state your agreement or disagreement with writer up un these questions guidelines 1) can empathy lead us astrary? how 2) our heart will always go out to the baby in the well, its a measure of our humanity. but empathy will have to yield to reason if humanity is to have a future can empathy yield to reason? how? thank you The Baby in the Well: The Case against Empathy* -Paul...

  • And there was a buy-sell arrangement which laid out the conditions under which either shareholder could...

    And there was a buy-sell arrangement which laid out the conditions under which either shareholder could buy out the other. Paul knew that this offer would strengthen his financial picture…but did he really want a partner?It was going to be a long night. read the case study above and answer this question what would you do if you were Paul with regards to financing, and why? ntroductloh Paul McTaggart sat at his desk. Behind him, the computer screen flickered with...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT