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

Answers

Answer 1
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)

Related Questions

Write a program to test if an integer input from the keyboard is odd or even. Sample Run 1: Enter a Number: 78 Even Sample Run 2: Enter a Number: 17 Odd

Answers

Answer:

number = int(input("Enter a number: "))

if number % 2 == 0:

   print("Even")

else:

   print("Odd")

Explanation:

Currently taking python at school. On the last few lessons.

Does technology always follow the science,yes or no explain why to choice

Answers

Answer:

No

Explanation:

because Technology does not always follow science but it may actually lead science in some instances. An example is weather forecasting.Again Mark me brainliest plz i really need it

Make a Flow Chart From this C Programming Language Code

Answers

Answer:

1) Print message "Hello Everybody"

If you wish to print a simple message "Hello everybody" in a flowchart in c language, here is the example:

flowchart in c

2) Input 2 numbers from the user and print their sum

Imagine that you are a user who wishes to put in two numbers and want their sum to be printed. Here is a flowchart for structure in c which is required:

flowchart in c language

3) Input numbers from the user and check whether it is even or odd

If you wish to put in numbers and then check whether it is an even number or an odd one, the following flowchart of c language can significantly help.

flowchart for structure in c

4) Flowchart to find the sum of the first 50 natural numbers

Let’s first see how that will look in a flow chart, and then we see the same thing mapped to a C program. This shows you why it’s important to map out your algorithm to a flow chart before you start coding it.

flow charts in c,

The loop easily translates to a simple C for loop. In this program, we initialize the variable sum =0 and n=0. In the next step, we increment n by 1 and assign sum=sum+n. We check if n=50 and if not, increment n by 1. Else we just print the sum.  

5) C Program to find the Factorial Value of a Number

Now let’s look at a bit more complex example. First, we’ll draw out the flow chart for the factorial n.

flowchart of if statement in c,

6) Control Algorithm for cooking toast in the toaster

Using a flowchart describe the control algorithm that a toaster might use to cook toast. There will be a start button the user pushes to activate the machine. There is another input that measures toast temperature. The desired temperature is preprogrammed into the machine. The output is a heater, which can be on or off. The toast is automatically lowered into the oven when the heat is applied and is ejected when the heat is turned off.

flowchart in c

7) Calculation of the average of two numbers

If we have to calculate the average of any two given numbers, the following flowchart for structure in c will be made.

flowchart in c language

Explanation:

mark me brainlist pls

Convert 12 bits to bytes​

Answers

Answer:

1.5 bytes

Explanation:

I byte = 8 bit ....

how to get a cheap iphone

Answers

Answer:

Win a iphone or you can get spectrum for $19.99 a month

Explanation:

Your welcome and you're free to ask me anything when you need me!

Hope this helps!

-Kristy

what changes might you make to a circuit in order to slow the flow of electrical energy?

Answers

it’s gravity that’s what my teacher said

Answer: The resistor uses the energy of the electrons around the wire and slows down the flow of electrons.

Explanation:

reflection image and design

Answers

Explanation:

It is the image and design

(Find the number of uppercase letters in a string) Write a recursive function to return the number of uppercase letters in a string using the following function headers: def countUppercase(s): def countUppercaseHelper(s, high): Write a test program that prompts the user to enter a string and displays the number of uppercase letters in the string.

Answers

def countUppercase(s):
count=0
for i in s:
if i.isupper():
count+=1
s=s.replace(i, "")
else:
s=s.replace(i, "")
countUppercase(s)
return count

element=input("Enter the string: ")
string=countUppercase(element)
print("\nNumber of upper letter in the string: ",string)

Write a program that asks the user for his or her name, then asks the user to enter a sentence that describes himself or herself. The program should ask for a destination file to save as the last question.

Answers

Answer:

there was a type of user name and sentences

Implement a function mystery( ) that takes as input a positive integer n and answers this
question. How many times can n be halved (using integer division) before reaching 1?

Answers

Count= 0
While n > 1
n = n
Count += 1
Return count

The function mystery that takes as input a positive integer n is given below. The number of times that can n be halved (using integer division) before reaching 1 is infinite.

What are function mysteries?

The non-negative integers are used to define the mystery function. The more common name of this method is hidden to avoid tempting you to explore the Web for assistance in completing this task, which would be a very dishonorable thing to do. Assume n has m bits.

Count= 0

While n > 1

n = n

Count += 1

Return count

Once. You now have 1/2. You can split 1/2 in half to make quarters, but that is not dividing one, it is dividing one half. If you mean how long the series of subsequent subdivisions you can make can be, the answer is infinite.

Therefore, the number of times that can n be halved (using integer division) before reaching 1 is infinite.

To learn more about function mysteries, refer to the below link:

https://brainly.com/question/14201335

#SPJ2

Making data secure means keeping it secret

Answers

Answer:

Data security refers to the process of protecting data from unauthorized access and data corruption throughout its lifecycle. Data security includes data encryption, hashing, tokenization, and key management practices that protect data across all applications and platforms.

Explain network optimization challenges of internet providers.

Answers

Answer:

The internet was initially used to transfer data packets between users and data sources with a specific IP adress.Due to advancements,the internet is being used to share data among different small,resource constrained devices connected in billions to constitute the Internet of Thing (IoT).A large amount of data from these devices imposes overhead on the (IoT) network.Hence,it is required to provide solutions for various network related problems in (IoT) including routing,energy conservation,congestion,heterogeneity,scalability,reliability quality of service (QoS) and security to optimally make use of the available network.In this paper,a comprehensive survey on the network optimization in IoT is presented.

Capstone Project part 11 quiz

What is the following code snippet checking? (1 point)
while response != "yes":

Othat response variable is not yet yes

O that response variable is yes

O if "yes" is indexed in an array for the variable "response"

O if the response variable is "no"



If you give all answers you will have an amazing Christmas!

Answers

It is checking if the response is not yet yes

What cable is used to connect devices together on a network?

Answers

Answer:

Ethernet crossover cable

Explanation:

.

Simple question: what is bandwidth?

Answers

The maximum amount of data transmitted over an internet connection in a given amount of time

Answer:

It is the amount of data that can be transmitted in a set period of time, that is the rate of data supported by the network connection.

In simple definition, it can be said to be the data transfer capacity of a computer network in bits per second (bps).

Explanation:

The problem below uses the function get_numbers() to read a number of integers from the user. Three unfinished functions are defined, which should print only certain types of numbers that the user entered. Complete the unfinished functions, adding loops and branches where necessary. Match the output with the below sample:


Enter 5 integers:

0 5

1 99

2 -44

3 0

4 12

Numbers: 5 99 -44 0 12

Odd numbers: 5 99

Negative numbers: -44

Answers

size=6

def get_numbers(num):
numbers = []
print('Enter %s integers:' % num)

for i in range(0,num):
print(i,end=' ')
user_input = int(input())
numbers.append(user_input) # Add to numbers list
return numbers

def print_all_numbers(numbers):
# Print numbers
print('\nNumbers:',end=' ')
for i in range(0,len(numbers)):
print(numbers[i],end=' ')

def print_odd_numbers(numbers):
# Print all odd numbers
print('\nOdd numbers:',end=' ')
for i in range(0, len(numbers)):
if numbers[i]%2!=0:
print(numbers[i], end=' ')


def print_negative_numbers(numbers):
# Print all negative numbers
print('\nNegative numbers:',end=' ')
for i in range(0, len(numbers)):
if numbers[i] <0:
print(numbers[i], end=' ')

nums = get_numbers(size)
print_all_numbers(nums)
print_odd_numbers(nums)
print_negative_numbers(nums)

What is the term for the action of Brazil imposing tariffs on US imports in response to the imposed tariffs by the U.S. on Brazilian exports to the United States ?

A. Reclaiming
B. Retaliation
C.retribution

Answers

I think the answer is B.

How many types of windows does Python use?



a.
four


b.
five


c.
one


d.
two

Answers

Question;

How many types of windows does python use?

Answer;

A.Four

Window does python use is Four

business cards can be send to other outlook users as email attachments or........

Answers

Answer:

Hey man, here is the answer

Explanation:

The easiest route is Forwarding the existing conversation to another person. The previous thread will be quoted in the new message.

The method in the question appears to be for preserving the top-down reading structure of the existing thread, of which there is no way I'm aware of. Often times, the aforementioned method of simply forwarding an email is enough to impart some context to the person.

Alternatively, one might view the entire thread, and create a PDF of it (possible from the Print dialog box on a Mac, or to save as a PDF in the File/Edit menus in certain windows applications), which they could then send in an email.

What sound customization option would you use in Scratch to simulate a sound happening in a large, empty room (like a theater)?
louder
reverse
echo
slower

Answers

C. Echo ( I May Be Wrong )

Answer:

Louder

Explanation:

what is computer hardware part​

Answers

Answer:

Computer hardware includes the physical parts of a computer, such as the case, central processing unit, monitor, mouse, keyboard, computer data storage, graphics card, sound card, speakers and motherboard. By contrast, software is the set of instructions that can be stored and run by hardware.

Explanation:

Answer:

Computer hardware is the physical parts of a computer system that is visible.

The parts of computer hardware is Central processing unit, Monitor, Mouse, Keyboard, Computer data storage, Motherboard, Speakers and Mouse.

Hope that helps. x

The hardware and software that must be implemented to support the applications that the primary activities use are a part of the ________ activities.\

Answers

The answer is infrastructure

Which item would a small business most likely used to meet its daily operational needs ?

Answers

They could use a Budget software

Answer:

Commercial, ready-to-use software

Explanation:

A data analyst is working with a data frame named retail. It has separate columns for dollars (price_dollars) and cents (price_cents). The analyst wants to combine the two columns into a single column named price, with the dollars and cents separated by a decimal point. For example, if the value in the price_dollars column is 10, and the value in the price_cents column is 50, the value in the price column will be 10.50. What code chunk lets the analyst create the price column

Answers

The code chunk that lets the analyst create the price column is;

unite(retail, “price”, price_dollars, price_cents, sep=”.”)

The code chunk unite(retail, “price”, price_dollars, price_cents, sep=”.”) is the one that will allow the analyst to create the price column.

The reason for that answer is that;

The unite() function would allow the analyst  to make the dollars and cents data to be combined into a single column.Meanwhile, in the parentheses of the given function, the analyst will write the name of the data frame.Next step for the analyst is to write the name of the new column in quotation marks.Next step is the names of the two columns they want to combine.Lastly, the argument sep=”.” will now place a decimal point between the dollars and cents data given in the price column.

Read more about programming at; https://brainly.com/question/15683939

A company purchases a flood insurance policy for its data center. What is its risk

management decision?

1) Mitigation

2) Acceptance

3) Avoidance

4) Transference

Answers

When a company purchases a flood insurance policy for its data center, the risk management decision it took is: 4) Transference.

Risk management can be defined as a process which involves identifying, evaluating, analyzing and controlling potential risks (threats) that are present in a business, which can serve as an obstacle to its capital, revenues and profits.

Basically, risk management decision typically involves prioritizing cause of action or potential threats, so as to avoid, mitigate or transfer the risk that are likely to arise from such business decisions.

The risks or threats that are faced by a business firm can be transferred to a third-party such as an insurance agency, especially to protect its assets and resources in the event of a natural disaster such as flood, fire, earthquake, etc.

In conclusion, transference is a risk management decision that occurs when  a company purchases a flood insurance policy for its data center.

Read more on risk management here: https://brainly.com/question/13760012

What’s the relationship among speed frequency and the number of poles in a three phase induction motor

Answers

Answer:

The number of poles in the windings defines the motor's ideal speed. A motor with a higher number of poles will have a slower rated speed but a higher rated torque.

Explanation:

The relationship among speed, frequency, and the number of poles in a three-phase induction motor is governed by what is known as the synchronous speed equation.

The synchronous speed of an induction motor is the speed at which the rotating magnetic field generated by the stator windings of the motor rotates.

The synchronous speed (Ns) of a three-phase induction motor is given by the following equation:

Ns = (120 × f) / P

where:

Ns is the synchronous speed in revolutions per minute (RPM).

f is the supply frequency in hertz (Hz).

P is the number of poles.

From the equation, it can be observed that the synchronous speed is directly proportional to the frequency and inversely proportional to the number of poles.

This means that if the frequency increases, the synchronous speed also increases, assuming the number of poles remains constant.

Conversely, if the frequency decreases, the synchronous speed decreases.

The actual speed of an induction motor is known as the rotor speed or slip speed, which is always slightly lower than the synchronous speed. The difference between the synchronous speed and the actual speed is referred to as slip and is necessary for the motor to induce a voltage in the rotor and generate torque.

It's important to note that the synchronous speed equation assumes an ideal motor with no load. In practice, the actual speed of the motor depends on various factors, including the load torque, rotor resistance, and motor design.

Learn more about synchronous speed equation click;

https://brainly.com/question/33166801

#SPJ2

Write code that assigns bigValue with the return value of calling the function GetBiggestValue passing number1 and number2 as arguments (in that order). Then, assign bigValue with the return value of calling GetBiggestValue passing bigValue and number3 as arguments (in that order).

Answers

Code:

Function GetBiggestValue(integer value1, integer value2) returns integer result
if value1 > value2
result = value1
else
result = value2

Function Main() returns nothing
integer userVal1
integer userVal2
integer userVal3
integer bigValue

userVal1 = Get next input
userVal2 = Get next input
userVal3 = Get next input

bigValue = GetBiggestValue(userVal1, userVal2)
bigValue = GetBiggestValue(bigValue, userVal3)

Put "Max value: " to output
Put bigValue to output

Questions Description Explain how you will identify and use texts according to the function you wish for it to serve in the particular industry​

Answers

The texts have different purposes that can be identified with the following tips:

Identify the main ideas. Identify the author's purpose.

What is a text?

A text is a term to refer to the set of phrases and words ordered coherently to be interpreted and to transmit the ideas of an author (emitter or speaker).

Texts can have a variety of topics depending on the author's intention. For example:

Scientific texts: They are the texts that have the purpose of sharing scientific information with exact data and results of experiments or others. Literary texts: They are the best known texts that stand out for including a diversity of topics, they are characterized by telling an in-depth story. News texts: They are the texts that expose all the details of a news story and have the purpose of objectively reporting.

According to the above, to identify a text it is necessary to read it and identify the main ideas and the purpose of its author when writing it. Additionally, the texts are tools for different professions to teach skills, knowledge and techniques depending on the requirement.

Learn more about text in: https://brainly.com/question/1142673

What is information technology in relation to computers

Answers

Answer:

Information technology (IT) is the use of any computers, storage, networking and other physical devices, infrastructure and processes to create, process, store, secure and exchange all forms of electronic data. ... The commercial use of IT encompasses both computer technology and telecommunications.

Answer:

Information technology (IT) is the use of any computers, storage, networking and other physical devices, infrastructure and processes to create, process, store, secure and exchange all forms of electronic data.

Explanation:

Hope this helps

Many subject elements make for simple and streamlined looking images. true or false

Answers

Answer:

Explanation:

false. many elements means a complicated picture, not a simple one.

The statement "Many subject elements make for simple and streamlined-looking images" is absolutely false.

What do you mean by Subject element?

The Subject element may be defined as the elements or components of the subject that are significantly responsible for constructing simple or complicated representations in the form of images.

It is a term or phrase that deals with the representation of fundamental topics on which a particular image relies. It significantly defines all the taxonomic attributes of the streamlined-looking images.

According to the context of this question, many subject elements will definitely lead to complicated and more streamlined images rather than simple ones.

Therefore, the statement "Many subject elements make for simple and streamlined-looking images" is absolutely false.

To learn more about Images elements, refer to the link:

https://brainly.com/question/26307469

#SPJ2

Other Questions
What does fat become after the chemical process? Who do you think the explorer is from the book "The Explorer" by Katherine Rundell. In the future pressing a panic button on your cell phone will. Reflect parallelogram EFGH with E(-4,5), F(3,6), G(2,3) and H(-5,2) in the x-axis. what are the coordinates of F? Help me plz plllzzzz A car is 200 inches long the truck is 50% longer than the car how long is the truck What of the following exponential functions is represented by the data in the table?A) f(x)=(1/3)^3B) f(x)=3^xC) f(x)=x^3D) f(x)=x1/3 pls help meeeeeeeeeee PLEASE HELP I DONT KNOW WHAT THE DIFFERENCE BETTWEEN THE TWO IS!What is the difference between a product and a reactant. B. Number the digestive process in the correct sequence. Write A-E on the blank 21. Food moves into the small intestine. 22. Food is stored and further broken down by acid and powerful enzymes 23. Your saliva helps break down what you're eating and turn it into chemicals called enzymes. 24..Food moves through your esophagus. 25. Anything left in the small intestine moves into the large intestine What is the equation of the line in standard form? if a car travels for 3 hours its average speed is 75km/h work out the total distance the car travels 14. The father of Italian Renaissance humanism was _______________. Read what grandpa and amara each say about grandma grace . Then complete the chart to tell what this shows about both grandpa and amara Read this line from "For You O Democracy."I will make inseparable cities with their arms about each others necksWhat does this line suggest? Democracy will create unbreakable bonds among people.Whitman worries democracy may limit the expression of individuality in society.Democracy is more likely to be successful in highly populated areas.Whitman believes democracy will look the same in every part of the country. Help help businesses please please What is the domain of the function y=2 square root x-5. The table shows the height of water in a pool as it is being filled. A table showing Height of Water in a Pool with two columns and six rows. The first column, Time in minutes, has the entries, 2, 4, 6, 8, 10. The second column, Height in inches, has the entries, 8, 12, 16, 20, 24. The slope of the line through the points is 2. Which statement describes how the slope relates to the height of the water in the pool? The height of the water increases 2 inches per minute. The height of the water decreases 2 inches per minute. The height of the water was 2 inches before any water was added. The height of the water will be 2 inches when the pool is filled The temperature at 7:00 a.m, was 12 C, and by 7:00 p.m, it had droppedto -10C. Which expression represents the change in temperature:(A 12 + (-10)(B 12 - 10(C -10 + 12(D -10 - 12 how many more seconds does it take to drive 1 mile at 40 miles per hour than 60 miles per hour