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
max2010maxim [7]
3 years ago
9

Add a data attribute tricks of type list to each Dog instance and initialize it in __init__ to the empty list. The user does not

have to supply a list of tricks when constructing a Dog instance. Make sure that you test this successfully. >>> sugar.tricks []
Computers and Technology
1 answer:
Olenka [21]3 years ago
7 0

Answer:

Following are the method to this question:

def __init__(self, _name, _breed):#defining Constructor

       """ Constructor """

       self.name = _name#assigning value in name variable

       self.breed = _breed#assigning value in breed variable

       self.tricks = []#defining tricks an empty list

Explanation:

In the above code, a parameterized constructor is defined, that hold two-variable "name and breed" in its parameter, and another object self is created for storing the value.

Inside the constructor two-variable, and one empty list variable "tricks" is defined that hold value in the name and breed variable, and the next step an empty list is defined, that store its value.

You might be interested in
Which options most accurately describe the information that should be included in note-taking? SELECT ALL THAT APPLY
velikii [3]
I think: B,C,D. You do not need to write notes on a thing that you will only see, but you need a date, key words, and main ideas.
4 0
4 years ago
Read 2 more answers
Design a circuit with the following criteria. Assume existence of +5V power supply. Draw your circuit and show your work. i. Inp
tresset_1 [31]

Answer:

see attached

Vin -5V- +5V

Input current : 500 x 10^-6 A

V_r: 0V 5V

I_r: 1 mA

Explanation:

Step 1: Circuit Designing: you have to address the question what is your proposed circuit going to do (its function).

Step 2: Decide on circuit components that can address each such circuit functions.

Step 3: Decide on the operational specification for the circuit: voltages, currents, frequencies etc.

Step 4: Simulate your circuit to confirm if it works as expected with simulation software such as Multisim.

4 0
3 years ago
"Use onblur and onfocus to add red borders to the input elements when the user leaves without any input, and a green border if a
strojnjashka [21]

Answer:

habla en español no te entiendo por favor

6 0
2 years ago
Write a C++ program that computes the area and perimeter of aspecified shape
leonid [27]

<u>C++ program that computes the area and perimeter of a specified shape</u>

#include <iostream>

#include <cmath>

using namespace std;

void rectangle() //Defining function for rectangle

{ int h,w;

cout << "Enter height: ";

//taking input

cin >> h;

cout << "Enter width: ";

cin >> w;

cout << "The perimeter of the rectangle is " <<2*h+ 2*w << " and the area is " <<h*w << endl;  //printing output

}

void triangle()  //Defining function for triangle

{ int s1,s2,s3,h,w;

cout << "Side 1: ";  //Taking input

cin >> s1;

cout << "Side 2: ";

cin >> s2;

cout << "Side 3: ";

cin >> s3;

cout << "Enter the height: ";

cin >> h;

cout << "Enter the base length: ";

cin >> w;

cout << "The perimeter of the triangle is " <<s1+s2+s3 << " and the area is " <<(.5)*w*h << endl; //printing output

}

void circle()//Defining Function for the circle

{

const double p=3.14;

int w;

cout << "Enter the radius: "; //Taking input

cin >> w;

cout << "The perimeter of the circle is " << p*2*w << " and the area is " << p*w*w<< endl;  //printing output

}

int main()  //driver function

{

int s;

cout << "Enter the shape (1 for rectangle,2 for triangle, 3 for circle): ";

//Asking user for the shape

cin >> s;

switch(s)  //checking which shape it chooses

{

case 1:

rectangle();  //If user type 1 ,then calling rectangle function

break;

case 2:

triangle();   //If user type 2 ,then calling triangle function

break;

case 3:

circle();  //If user type 3,then calling circle function

break;

default:

cout <<"Enter valid choice for shape";  //If user type other than 1,2,3

}

return 0;  

}

<u>Output</u>

Enter the shape (1 for rectangle,2 for triangle, 3 for circle): 1

Enter height:2

Enter width: 3

The perimeter of the rectangle is 10 and the area is 6

<u />

4 0
3 years ago
Identify the root folder in the absolute path /folder1/folder2/folder3/file.
Lilit [14]
Absolute path always start from the root folder.
folder 1 /folder 2 / folder 3 / file.
Here the path start from folder 1, which is the root folder.
Folder 2 and folder 3 are the sub-folders.



Answer: Folder 1
3 0
3 years ago
Read 2 more answers
Other questions:
  • What do i study to become a network engineer?
    11·1 answer
  • What is the QOS model?
    6·1 answer
  • The undo function allows the user to cancel up to _____ previous typing actions.
    9·1 answer
  • .____________ is a way to identify and differentiate goods andservices through use of a name or distinctive design element.
    10·1 answer
  • Any material that comes into contact with the body must be __________.
    6·1 answer
  • Write 3 things that can't be done without technology. write your opinion?
    14·2 answers
  • Answer This One Question Right For Brainliest
    10·1 answer
  • Задание: Построить иерархию классов в соответствии с вариантом задания. Построить диаграммы классов.
    8·1 answer
  • In ____ orientation, a page is taller than it is wide.
    11·1 answer
  • I need help with my work
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!