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
Yuki888 [10]
3 years ago
13

Can somoene explain the function of-def __init__():In python programming language​

Computers and Technology
1 answer:
JulsSmile [24]3 years ago
8 0

Answer:

def is a keyword used to define a function, placed before a function name provided by the user to create a user-defined function

__init__ is one of the reserved methods in Python. In object oriented programming, it is known as a constructor. Python will call the __init__() method automatically when you create a new object of a class, you can use the __init__() method to initialize the object’s attributes.

Example code:

class Person:

 def __init__(self, name, age):

   self.name = name

   self.age = age

p1 = Person("John", 36)

print(p1.name)

print(p1.age)

Summary

  • Use the __init__() method to initialize the instance attributes of an object.
  • The __init__() doesn’t create an object but is automatically called after the object is created.
You might be interested in
After you select your recipients, the next step in using the Mail Merge Wizard would be to _____.
NARA [144]

Answer:

Write your letter

Explanation:

When using a Mail Merge Wizard in a Microsoft Word Document, this is the process.

  • Click on your document type
  • Click on the starting document
  • Select the recipient(s)
  • Write your letter and add some custom fields
  • Insert your address Block
  • Strike enter and click on Greeting line (to enter a greeting)
  • Preview your letter and click on complete merge
3 0
3 years ago
Read 2 more answers
Match each type of option on the left with a corresponding function on the right.
Marta_Voda [28]

Answer:

yes. the above is correct

Explanation: q posted

7 0
2 years ago
If a printer is not Wi-Fi capable, how can it be set up to provide the most reliable wireless printing
SCORPION-xisa [38]

Answer:

Well you can use bluetooth since it doesn’t require wifi and it would still work if your printing a file from your computer or your flash drive.

5 0
3 years ago
Read 2 more answers
Which of the following refers to the informal rules for how to behave online?​
Feliz [49]

Answer:

Question: Where is the following?

3 0
3 years ago
Read 2 more answers
Please someone participate in my typing race ...
dsp73

Answer:

what is typing race

this link can not be clicked

8 0
3 years ago
Other questions:
  • PPPLLLLEEEEAAASSSSEEEEE HHELLP me.Does anyone know how to copy an image onto a thing so i can post a real question on brainly. b
    8·2 answers
  • ?an ip address reservation is made by creating an association between an ip address and what type of client identifier?
    7·1 answer
  • What is the preferred procedure for putting customers on hold​
    13·2 answers
  • Write a program that prints the U.S. presidential election years from 1792 to present day, knowing that such elections occur eve
    9·1 answer
  • This is a text message that is stored on a user's computer by a Web server that helps trace the user's browsing habits. a. Scrip
    14·1 answer
  • What is NOT an issue associated with tag management systems? There is no automation available for tag management systems. Managi
    5·1 answer
  • Based on the code you created in this Unit, propose a way to re-use most of the code (with different information in the variable
    14·1 answer
  • 13. A 2-sided coin has an equal likelihood of landing on each side. One side is called "heads" and the other is called "tails".
    11·1 answer
  • To control how and when the slides should appear during the slide show, we use the__________________ feature​
    12·1 answer
  • Why crt and plasma are not used in laptop ?​
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!