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
padilas [110]
3 years ago
15

What will be the output of the following Python code? class A: def test1(self): print(" test of A called ") class B(A): def test

(self): print(" test of B called ") class C(A): def test(self): print(" test of C called ") class D(B,C): def test2(self): print(" test of D called ") obj=D() obj.test()
Computers and Technology
1 answer:
Vlad [161]3 years ago
7 0

Answer:

"test of B called"

Explanation:

  • The object is created for the D class, but there are two test methods in class B and C.
  • The D class does not hold any test method. So when the object called the test method. Then the B method is called.
  • It is because the B class is declared first in the inheritance of D class like in the statement "class D(B, C)".
  • If the statement will be "class D(C, B)", then the C method will be called.
  • if the D class holds the method test, then only the D method will be called.
  • Hence the output is "test of B called".
You might be interested in
How did Bill Gates benefit from free enterprise? Need a paragraph please. Will give the branliest!!
olchik [2.2K]

Answer:

Bill Gates used his skills and brains to build a business. In conclusion, Bill Gates was very successful with his industry thanks to free enterprise. He, along with his employees and friends, created and almost perfected the software known as Microsoft. The free enterprise system provides the right to private enterprise, which allowed him to choose his own business and to run it without governmental influence. Because he could create his own business and design his own products, Gates was able to specialize in technology.

Explanation:

8 0
2 years ago
Write a static generic method PairUtil.minmax that computes the minimum and maximum elements of an array of type T and returns a
Gnesinka [82]

Answer:

Explanation:

The following code is written in Java. It is hard to fully create the code without the rest of the needed code including the T class and the Measurable interface. Regardless the following code can be implemented if you have that code available.

 public static T minmax(ArrayList<T> mylist) {

       T min = new T();

       T max = new T();

       for (int x = 0; x < mylist.size(); x++) {

           if (mylist.get(x) > max) {

               max = mylist.get(x);

           } else if (mylist.get(x) < min) {

               min = mylist.get(x);

           }

       }

       

       return (min, max);

   }

5 0
2 years ago
Write a code segment that takes an emailaddress stored in the string email and stores theuser name in the string user and the ho
iragen [17]

Answer:

#include <bits/stdc++.h>

using namespace std;

int main() {

  string email,username,host;//strings to store email,username,hostname..

  cout<<"Enter the email address "<<endl;

  cin>>email;//taking input of email address..

  bool flag=1;

  for(int i=0;i<email.length();i++)//iterating over the string email..

  {

      if(email[i]=='@')//if @ symbol is encountered make flag 0 skip this iteration.

      {

          flag=0;

          continue;

      }

      if(flag==1)//add to username if flag is 1.

      {

          username+=email[i];

      }

      else//add tom host..

      host+=email[i];

  }

  cout<<"The username is "<<username<<endl<<"The host name is "<<host;//printing the username and hostname..

return 0;

}

Explanation:

I have taken  three strings to store the email address entered by user ,username and host to store username and host name respectively.Then I am iterating over the string email if @ is encountered then skip that iteration before that keep adding characters to username string and after that keep adding characters to host.

8 0
3 years ago
John Cleaver is the CEO of Tech World, which is a retail store that sells computers, monitors, cameras, televisions and many oth
Norma-Jean [14]
The answer would be b. Contemplate other products to introduce at the same time in this new market.
5 0
3 years ago
The blank contains the computer's brain the central processing unit CPU
Mila [183]

The Motherboard contains the computer's brain which is the Central Processing Unit (CPU).  It is the main circuit board for the computer, containing both soldered, non removable components along with sockets or slots for components that can be removed. The motherboard holds the CPU, RAM and ROM chips, etc.

7 0
2 years ago
Other questions:
  • Sam's manager would like him to create and distribute copies of a budget report for each department. The budget report should sh
    8·2 answers
  • Students are studying the effects of beach pollution by counting populations of seagulls at two different beach locations. One l
    7·1 answer
  • Which of these browsers was the first widely adopted?
    12·1 answer
  • A(n _______________ is a pre-written formula that is built into excel
    12·1 answer
  • Fourlotts Corp. provide integrated services that include storing manufactured goods, packaging, and delivering it to the dealers
    13·1 answer
  • Where is the typical location of a touchpad inside of a laptop?
    13·1 answer
  • What are the pasting options in Outlook 2016? Check all that apply.
    10·2 answers
  • Chuck plans to go on a hiking trip. Before the hiking trip, Chuck's bank account has $129.50. He then spends $129.50 on hiking g
    6·1 answer
  • Which of the following is a characteristic of vector graphics?
    15·2 answers
  • GOOD EVENING, FRIENDS, I WANT TO ASK ON THE ACCOUNT OF HIS NAME‏BENJEMIN360 . THIS ANSWERS ARE VERY WONDERFUL, BUT I CAN'T COMMU
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!