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
blsea [12.9K]
2 years ago
13

Which line of code will create an instance of the pet class?

Computers and Technology
2 answers:
Sunny_sXe [5.5K]2 years ago
8 0

Answer:

myPetA = pet(self, 'dog', 'Spot')

Explanation:

I mite be wrong

saul85 [17]2 years ago
8 0

Answer:

myPetA=pet('dog','Spot') or C

Explanation:

credit to who deserves it, the guy in the other answers comment section confimed my thought

You might be interested in
What is included on the HP PC Hardware Diagnostics 3-in-1 USB Key that allows you to recover systems that cannot boot?
algol13

Answer:

HP PC Hardware Diagnostics UEFI

Explanation:

The 3-in-1 HP PC Hardware Diagnostics UEFI USB Key helps the client distinguish potential software, hardware, and Operating System issues. Both older and newer HP Desktop and Laptop PCs come with this tool installed. By default, it operates outside the OS to detach equipment issues from other system issues. In the event you do not have it pre-installed, you can get it from the official HP site.

3 0
3 years ago
Write the function definition for a function called list_total that accepts a list of integers
uranmaximum [27]

Answer:

def list_total(numbers):

   sum_of_numbers = 0

   for number in numbers:

       sum_of_numbers += number

   return sum_of_numbers

Explanation:

So, to define a function, the syntax is simply:

def functionName(arguments here):

   # code

So to define a function called "list_total" which accepts a list of integers, you write:

"

def list_total(numbers):
   # code

"

any the "numbers" is a parameter, and it's just like any variable, so you can name it anything besides keywords. I just named it "numbers" since it makes sense in this context, you could also write "integers" instead and it would be just as valid, and may be a bit more specific in this case.

Anyways from here, the initial sum should be equal to 0, and from there we add each number in the list to that initial sum. This can be done by initializing a variable to the value "0" and then traversing the list using a for loop. This can be done as such:

"

def list_total(numbers):

   sum_of_numbers = 0

   for number in numbers:

       # code

"

So for each element or integer in the list "numbers" the for lop will run, and the variable "number" will contain the value of the current element it's on.

So we can add the "number" to the sum_of_numbers as such:

sum_of_numbers = sum_of_numbers + number

but there is a shorter way to do this, and it's represented as:

sum_of_numbers += sum_of_numbers

which will do the same exact thing. In fact this works for any mathematical operation for example:

a *= 3

is the same thing as

a = a * 3

and

a /= 3

is the same thing as

a = a / 3

It's the same thing, but it's a much shorter and more readable notation.

Anyways, this code will go in the for loop to almost finish the code

"

def list_total(numbers):

   sum_of_numbers = 0

   for number in numbers:

       sum_of_numbers += number

"

The last thing is to return this value, and this is simply done by using the syntax:

"return {value here}"

and since the sum_of_numbers has the value, we write

"return sum_of_numbers"

at the end of the function, which is very very important, because when you use the return keyword, you end the function, and return whatever value is next to the return to the function call

So to finish the code we just add this last piece to get:

"

def list_total(numbers):

   sum_of_numbers = 0

   for number in numbers:

       sum_of_numbers += number

   return sum_of_numbers

"

7 0
2 years ago
The data selected to create a table must include
Novay_Z [31]

The column names and data types.

4 0
3 years ago
Read 2 more answers
What is the most useful advantage of social media in an emergency response effort?
gladu [14]
Being able to communicate directly with constituents.

ability to build situational awareness speed in which information can be delivered directly to the public
4 0
3 years ago
A(n) ________ is a wonder of miniaturization combining a CPU, GPU, and sundry other support logic onto a single silicon die, sav
erma4kov [3.2K]

Answer:

system on a chip (SoC)

Explanation:

4 0
2 years ago
Other questions:
  • It is safe to use your bright headlights if there is a car ahead of you within 300 feet
    9·2 answers
  • If you are trying move a hard drive from a non-working computer to a working computer for the purposes of accessing the data on
    5·1 answer
  • (EASY 15 POINTS) What are two indications in a browser that a secure connection is being used?
    6·1 answer
  • Three of the most important jobs of security management are to ensure _____ are organized according to sensitivity, ensure that
    10·1 answer
  • ____________ facilitates the processes that help an organization function by applying information and communication technologies
    5·1 answer
  • Write a program that asks the user to enter the size of a triangle (an integer from 1 to 50). Display the triangle by writing li
    14·1 answer
  • Any material that comes into contact with the body must be __________.
    6·1 answer
  • Explain how mobile phone production could be more sustainable​
    8·2 answers
  • Transitive spread refers to the effect of the original things transmitted to the associate things through the material, energy o
    6·1 answer
  • Which device allows you to convert sounds into digital format to be used on the computer​
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!