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
The security administrator of ABC needs to permit Internet traffic in the host 10.0.0.2 and UDP traffic in the host 10.0.0.3. Al
koban [17]

Answer:

The correct selection is the letter C. The first ACL is denying all TCP traffic and the other ACLs are being ignored by the router.

Explanation:

In this case, the letter C is the right answer because with the first ACL exactly:

access-list 102 deny tcp any any

We are denying all traffic with the next line deny tcp any any, in this case, the others line are being ignored.

access-list 104 permit udp host 10.0.0.3 any

access-list 110 permit tcp host 10.0.0.2 eq www any

access-list 108 permit tcp any eq ftp any

For that nobody can access to the internet, the security administrator of ABC must change the first ACL.

5 0
3 years ago
Why are businesses willing to provide more goods at higher prices
irina1246 [14]
It depends on what kinda "goods" your talking about clothes they don't have a choice cause material costs a lot overall it's their way of getting a lot of money because some people do fall for the prices and their is a lot of competition around some businesses
5 0
2 years ago
A _____ chart provides a simple way to show trends and variations in a range of data within a single cell
ludmilkaskok [199]
Most reasonable answer is a line chart.
 
With line charts you can spot trends and variations in a certain range of data through different times or just different values of the variable that we plot on the x-axis. In general, line charts are often used in research that wants to depict time trends or how a certain variable progresses through different levels of the variable on the x-axis.
8 0
3 years ago
HELP PLEASE GIVING BRAINLIEST
Phoenix [80]

Answer:

CompTIA A+ there ya go!!!

5 0
3 years ago
Read 2 more answers
Which part of the cerebrum is associated with hearing and memory?
Brut [27]
I'm pretty sure it's the frontal lobe
4 0
3 years ago
Read 2 more answers
Other questions:
  • Design an algorithm for finding all the factors of a positive integer. For example, in the case of the integer 12, your algorith
    8·1 answer
  • Science is a body of knowledge that extends back to Select one: a. the time of Galileo. b. Italy in the 16th century. c. Greece
    6·1 answer
  • Hackers who gain control over several computers can organize them into a client-server network known as a(n) __________ . This n
    7·1 answer
  • Which PowerPoint options can users customize?
    9·1 answer
  • "The ____________________ function is a logical function that returns a TRUE value if any of the logical conditions are true and
    14·1 answer
  • What is the analysis stage in System development life cycle?
    12·1 answer
  • Speeding is one of the most prevalent factors contributing to traffic crashes.
    12·1 answer
  • Anyone watch anime, i love stay kids and they sang the op for Tower of God XD
    8·2 answers
  • The local library dealing with a major computer virus checked its computers and found several unauthorized programs, also known
    12·2 answers
  • 1. The supervisory software of a computer is called _____ (a) operating system (b) high – level language (c) transistor
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!