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
A(n) ____ is a set of computer instructions.
sesenic [268]
A[n] program is a set of computer instructions.
4 0
3 years ago
Which design principle is the subject of a photo or image?
MakcuM [25]

Answer:

B) Framing is the answer to your question

8 0
3 years ago
Concatenating arrays Strings have build-in functions to perform concatenation. Write a function called append () that performs c
olganol [36]

Answer:

Check the explanation

Explanation:

#include<iostream.h>

#include<stdlib.h>

void append(char* first,int n,char* second, int n1,char* result)

{

  int i,j=0;

  for(i=0;i<n;i++)

      result[i]=first[i];

  for(i=n;i<n1+n;i++)

  {

      result[i]=second[j];

      j++;

  }

}

void main()

{

  char first[]={'I', ' ','a', 'm', ' '};

  char second[]={'i', 'r', 'o', 'n', 'm', 'a', 'n','\0'};

  char result[200];

  append(first,5,second, 8, result);

  cout<<result;

  cout<<endl;

  system("pause");

}

4 0
3 years ago
Which method represents a change in data formats? A) Data reusing B) data re-engineering C) Data warehousing D) data mining
jenyasd209 [6]

I believe the answer would be data re-engineering, B, by using the process of elimination. Hope I was able to help!

4 0
3 years ago
Tech companies prepare for cyberattacks using common cybersecurity resources. Select one of the resources listed and explain how
GenaCL600 [577]

Explanation:

Tech companies focus on making advancement in technology products and services. They are driven by innovations and the use of technology to make them standout from other companies.  They uses technology to render services.

Cyber attack is a deliberate attack on companies' computers or on an individual computer with the intention of stealing information, or other reasons without victim approval.

How policies on encryption could be implemented to prevent cyber attacks by:

Cyber security policies explain the guidelines on how organization staffs and end-users access online applications and internet resources without fear of security details being hacked.

1. Rules should be set on how to use email encryption: This rule should be easy to read. Emails should be encrypted to provide safety from cyber attacks. Contents should not be visible, should only be visible to those sending and receiving such emails.

2. Rules on encryption of sensitive messages and back up data.

3. rules on encryption of Log in details and passwords

7 0
3 years ago
Other questions:
  • Tanya is entering the amount of money she has earned from babysitting onto an Excel spreadsheet, but the AutoComplete feature is
    9·2 answers
  • Consider the following relation: CAR_SALE (Car#, Date_sold, Salesman#, Commision%, Discount_amt Assume that a car may be sold by
    15·1 answer
  • If the user enters 26 what is output? _____________
    15·1 answer
  • Write a program with the total change amount as an integer input, and output the change using the fewest coins, one coin type pe
    13·1 answer
  • I have been trying for 2 days to make an account, but it says registration cannot be completed at this time. It is extremely ann
    12·2 answers
  • What is the protocol for getting to the Web?
    9·2 answers
  • List of bad websites and why
    10·1 answer
  • Select the correct answer.
    14·1 answer
  • The _____ feature enables you to represent text as colorful visuals.
    15·1 answer
  • An outpatient provides the following id: barbara jones, birth date 8/15/63. should a specimen be collected for this lab order?
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!