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
Rama09 [41]
3 years ago
6

Define the method object inc_num_kids() for PersonInfo. inc_num_kids increments the member data num_kids. Sample output for the

given program with one call to inc_num_kids(): Kids: 0 New baby, kids now: 1
Computers and Technology
1 answer:
CaHeK987 [17]3 years ago
7 0

Answer:

The answer to this question can be given as:

Program:

#define class.

class PersonInfo:

   def __init__(self):  #constructor

       self.num_kids = 0

   def inc_num_kids(self):   #define function inc_num_kids()

       self.num_kids = self.num_kids + 1  

       return self.num_kids  #return value.

p= PersonInfo()      # creating object  

print('Kids:', p.num_kids)  #print value

p.inc_num_kids() #call function

print('New baby, kids now:', p.num_kids) #print value

Output:

Kids: 0

New baby, kids now: 1

Explanation:

The description of the above python program as follows:

  • In this program firstly we define the class that is PersonInfo. In this class we define the constructor that is def __init__() and one function that is  def inc_num_kids().
  • The constructor is called automatically when the class object is created. In this constructor, we use the self as a parameter that is used to access variables that belong to class.
  • In the constructor, we define the variable that is "num_kids". We assign value to a variable that is "0" and use the self for holding reference to the variable.
  • Then we define the function. In this function, we increment the value of the variable by 1 and return its value.
  • Then we create a class object that is p and call the function and print its value.  

You might be interested in
Is media good for the brain?
skad [1K]

Of course yes, and that depends of the type of content that you eaten =D

Media is a source of good information for to create your opinion.

Best regards

7 0
3 years ago
Read 2 more answers
Positive and negative impacts of chemical industries
Nonamiya [84]
5. Positive and Negative Impact of chemical industries. Here are the positive impacts first: => It can discover a chemical product that can be helpful for us humans like physical beautification, medicines to a certain diseases and more that is beneficial to our health. => It can also help us learn more about the chemicals that is presents in our planet. Here are the lists of the negative impacts: => Some Chemicals can be harmful to the nature and also to our body. => Some chemical can cause diseases especially those harmful ones.
4 0
3 years ago
Read 2 more answers
Most of the Desktop games contain a backdoor used to test and update the game.
sveta [45]

A backdoor is a typically covert method of bypassing normal authentication or encryption in a computer, product, embedded device (e.g. a home router), or its embodiment (e.g. part of a cryptosystem, algorithm, chipset, or even a "homunculus computer" —a tiny computer-within-a-computer such as that found in Intel's AMT technology).Backdoors are most often used for securing remote access to a computer, or obtaining access to plaintext in cryptographic systems. From there it may be used to gain access to privileged information like passwords, corrupt or delete data on hard drives, or transfer information within autoschediastic networks.

the answer is True

i hope it will help you

8 0
3 years ago
A palindrome is a string that is the same regardless of whether your read it forward or backward, assuming you ignore the spaces
pashok25 [27]

Answer:

The explanation for this question is describes in the explanation section below.

Explanation:

A palindrome is a number, string, expression or certain character pattern that appears the very same backward as a forward.

Below is an algorithm for the series:

Step 1: Creates an object of generic stack-type of string set.

Step 2: Accept the sequence from those in the user as its entry.

Step 3: Throughout the specified set, disregard the white space.

Step 4: Build an object for the reverse string to be stored.

Step 5: To store the stack into the string, place the object that has come into the stack.

Step 6: Test whether the reversed string equals the initial string.

Step 7: Display the message of success.

Step 8: Display the message of failure when the strings aren't the same.

6 0
3 years ago
My current lesson is The Excel Screen and Worksheets and the question is:
Usimov [2.4K]
I can't tell you the answer without a picture, but to find the answer yourself: Go straight up from the cell containing 'Activity Questions' this will tell you a letter such as B. Go directly across to the left of the cell containing 'Activity Questions' this will tell you a number such as 3. The name of the cell I used as an example would be called B3.
3 0
3 years ago
Other questions:
  • To add and remove chart elements, you can use the add chart element button in the charts layout group on the ____ tab.
    6·1 answer
  • to prevent long page load time for pages containing images. It is best to use a compress file formatlike jpeg as well as appropr
    6·2 answers
  • Part cost Calculator Modify the GUI in your program to look like the following GUI. To do that you need to add the following to
    13·1 answer
  • RFID tags uses memory that is read-only.A. TrueB. False
    5·1 answer
  • (fill in the blank) <br><br> ____ is when data is formatted, transmitted and received in a network.
    13·1 answer
  • Write a program that creates an integer array with 40 elements in it. Use a for loop to assign values to each element of the arr
    5·1 answer
  • he degree of operating leverage is equal to: Group of answer choices FC / OCF. VC / OCF. 1 FC / OCF. 1 VC / OCF. 1 Picture FC /
    9·1 answer
  • A ____ is a a set of presentation rules that control how text should look. It is applied to an XML file to change the collection
    9·1 answer
  • Multiple choice:
    12·2 answers
  • The photo shows a group of girls reacting to comments they have read about a classmate on a social media site.
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!