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
Describe shortly about the following Linux directories and theirpurpose,1. lib2. etc3. Boot4. Root5. home
Bingel [31]

Answer:

 Linux directories and their purposes are:

1) lib - Lib file contained the share object library file which necessary to boots system and this directory contain file module stored in the kernel.

2) etc - etc file is the configuration file that they are local in the machines. When the program run these file are stored in the directories. this can be static and do not executable directory.

3) Boot - Boot file are stored in the directory which required processing of linux boot and such files are included in the linux kernel of the file.

4) Root - Root file are the best user root directory and user cannot view this directories from there account. This file usually contain administrative file system.  

5) Home - Home file contained the user directory and it is the default system of linux. Home directory helps user to enable any network system to access there home directories.

5 0
3 years ago
Please tell me about Advantages and disadvantages of technology development​
hoa [83]

Answer:

idkidkkkkkkkkkkkkkkkkk

3 0
3 years ago
Read 2 more answers
Which of these is NOT an advantage of the impact of computer careers.
nikdorinn [45]
I believe the answer could be the first choice. I'm not quite sure, though
4 0
3 years ago
Read 2 more answers
Do you think children should have their own mobile phones? Why or why not?
Svet_ta [14]

Answer:

Yes

Explanation:

I as a parent think children should have their own mobile phone.

Safety reason being the main reason, because there are too many instances with child abductions, school shootings. It's not like it was 30 years ago when I was a child and we could hang out all over the neighborhood and parents knew each other and watched out for everyone's child. In today's society there is so much danger lurking that you have to protect your child the best way you can, and with our children having mobile phones it allows constant contact with our children. Plain and simple in case of emergencies.

5 0
4 years ago
Read 2 more answers
What effects convert colors in a picture to a wide variety of hues?
nadezda [96]
I believe it's color saturation.
3 0
3 years ago
Other questions:
  • C. you have already verified the routing table entries for r1, now execute the show run | section interface command to verify vl
    11·1 answer
  • Although you are not a full administrator, you are asked to manage a protected document, allowing customized access to any inter
    7·1 answer
  • The use of _______________ can validate input responses from clients and prevent certain attack methodologies
    14·1 answer
  • What is ana absolute adress
    11·1 answer
  • The getting started screen in Microsoft publisher consists of which main parts?​
    7·1 answer
  • An individual posing as an online gamer accesses information stored in an unsuspecting user’s computer by placing a program in h
    11·1 answer
  • Question B_1 (15 points) Please define (describe) local variables and how they are used in computer programming ( e.g. In C, C )
    6·1 answer
  • PLZ HELP I DIDNT MEAN TO CLICK THAT ANSWR I NEEDD HELP
    15·1 answer
  • It is recommended that systems administrators analyze logs in order to determine if they have been altered because monitoring ca
    14·1 answer
  • Universal containers wants internal support requests to be directed to any of the IT reps. They want external support requests t
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!