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]
2 years ago
13

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

Computers and Technology
1 answer:
JulsSmile [24]2 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
What is one major component that would not be found in a tablet or phone, and how has modern computing made that component less
IRISSAK [1]

Answer:

A hard drive

Explanation:

Since tablets and phones are compact, they are better off not having a big, giant, bulky storage device like hard drives. Modern computing made hard drives less important by developing Solid-State Drives (SSDs) and extremely dense (512 bit) storage that can provide the same if not more storage than a traditional hard drive at the fraction of the size.

5 0
3 years ago
Read 2 more answers
Users of an extranet can access a company or organization’s entire intranet
Tasya [4]

Answer:

yes

Explanation:

yes

4 0
2 years ago
Read 2 more answers
Choose the answer.
expeople1 [14]

There are no options can u give options.

4 0
3 years ago
What is the difference between the casual and consultative conversation? Why is it important for a person to know the difference
leonid [27]

Answer:

The answer is below

Explanation:

Casual conversation is a form of conversation that occurs between friends and families. There are no specific rules or manner in which the participants speak to each other. It is otherwise known as Informal Conversation.

Consultative conversation on the other hand is a form of conversation that occurs between people who have a close relationship but not actual friends or families.

For example, people involved in this type of conversation are the likes of Doctors and Patients, Counsellors and Students, etc. It is often considered a Semi-formal conversation.

The reason a person needs to know the difference between the two styles of conversation is for individuals to know how to present and conduct themselves appropriately during the conversation.

7 0
2 years ago
What is the purpose of the Split command?
liq [111]

Answer:

a split command in the linux system re used for dividing large files into pieces

8 0
2 years ago
Read 2 more answers
Other questions:
  • They predicted another cold day in Seattle. They predicted another windy day in Seattle. Combine the sentences into one sentence
    8·1 answer
  • Explain how software is distinct from hardware.
    8·2 answers
  • Compare userNumber with compareNumber and display 'Numbers are not equal' if the numbers are different. Then, display 'Variables
    11·1 answer
  • . Let F(X, Y, Z)=(X + Y + Z)(X + Y + Z)(X + Y + Z)(X + Y + Z). Use a 3-variable K-Map to find the minimized SOP form of this fun
    15·1 answer
  • The language C was originally developed by​
    11·2 answers
  • Advancements in nuclear science have led to technological advances which are both harmful and beneficial. Which would be conside
    15·1 answer
  • Your friend's job pays $5.00 per hour, and he works 20 hours per week. His tax rate is 20 percent. Assuming he works 50 weeks of
    11·2 answers
  • What are specific and relevant terms that will help you locate information using an internet search engine?
    10·1 answer
  • Owen is writing a program that will lock his computer for one hour if the incorrect password is entered more than five times. Ha
    14·1 answer
  • The Internet is a worldwide communications network. Which device connects computer networks and computer facilities?
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!