1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
k0ka [10]
2 years ago
11

Write a class definition line and a one line docstring for the class Dog. Write an __init__ method for the class Dog that gives

each dog its own name and breed. Test this on a successful creation of a Dog object. >>> import dog >>> sugar
Computers and Technology
1 answer:
Viefleur [7K]2 years ago
4 0
Python Code:

class Dog:
""" Dog class definition """

# data attribute species as part of the class Dog
species = "Canis familiaris"

def __init__(self, _name, _breed):
""" Constructor """
# Assigning values
self.name = _name
self.breed = _breed
self.tricks = []

def teach(self, trick):
""" add a passed string parameter to tricks """
# Adding to list
self.tricks.append(trick)
# Printing message
print(self.name + " knows " + trick)


def knows(self, chkStr):
""" check whether a passed string parameter is in the dog’s list of tricks """
# Checking in tricks list
if chkStr in self.tricks:
# Printing message
print("Yes, " + self.name + " knows " + chkStr)
else:
# Printing message
print("No, " + self.name + " doesn't know " + chkStr)
You might be interested in
Research and describe a recent development in theater and film lighting and explain how the technology can be used. (Maybe limit
Hunter-Best [27]

Answer:

A computerized light dimmer is one helpful development in lighting equipment. Computerized light dimmers help to control the brightness of light. These dimmers lower or increase the intensity of light. I first noticed light dimmers in a scene from the movie Children of Men. In a war scene, innocent people are shown running helter-skelter to save their lives. Artificial lights are used in scene to create that dark appearance in broad daylight, which makes the scene look gloomy and scary. It helped to generate the feeling of uncertainty and suspense through the proper use of lights. Light dimmers help light designers to create the exact atmosphere that the director demands for a scene. Also, because of dimmers, a light designer need not use extra accessories to diffuse light or make the scene brighter.

Explanation:

This is Plato's sample answer so take pieces out.

6 0
3 years ago
Read 2 more answers
Which type of transmission do modems use ?
horsena [70]
Asyncronous is the answer I think
6 0
3 years ago
Read 2 more answers
What did early computers use to store each bit?
Damm [24]

Answer:

A vacuum tube

4 0
3 years ago
Read 2 more answers
Programs which were typically reserved for college-level classes such as computer animation and CAD programs are now being appli
Irina-Kira [14]
Answer: I think C


Step by step explanation:
8 0
3 years ago
What would be a suitable device to transfer 12 photos from one PC to another?
Arlecino [84]

Answer:

A memory stick.

Explanation:

A memory stick can be defined as a storage media device with flash memory. They are mainly used in smart or portable electronic devices such as mobile phones, digital cameras, mp3 players, camcorders, etc.

Memory sticks are usually small in size and as such are easily accessible for the transfer of digital files such as images, videos, audios from a portable device or computer to another device such as a computer.

Hence, a memory stick would be a suitable device to transfer 12 photos from one PC to another.

3 0
3 years ago
Other questions:
  • Assuming your computer only has one network card installed; explain how your virtual machine is able to share that card with you
    10·1 answer
  • Your IT manager wants you to set up three computers to appear to users as one powerful Windows Server 2016 server. What capabili
    14·1 answer
  • "If a program attempts to modify (or, sometimes, even to read) the contents of memory locations that do not belong to it, the op
    11·1 answer
  • Mary works for a multimedia firm, and she spends long hours on a desktop computer. Recently, she expired back pain and visited h
    12·1 answer
  • What is one advantage and disadvantage of designing a support security that might be based on a centralized model, where all sen
    11·1 answer
  • How do you create multiple columns in Word?
    9·1 answer
  • Which is the correct option?
    6·1 answer
  • Help me<br>please answers this questions<br>​
    6·1 answer
  • 1. (A) What do you mean by computer? Discuss the use of<br> computer in daily life.
    14·2 answers
  • Choose the missing term.
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!