Python Tutorial
How To Import Work In Python

Hello, Guy’s Welcome To The Another Python Article, In This Article We Learn How To Import Work In Python.

What is Work?

Before We Understand How To Import Work In Python, First We Understand That What is Work. Work is Nothing But A Project or Python File That You Created Or That Already Created By Python Community.

How To Import Work In Python

In Python, There Are Two Different Method That Helps You To Import Any File In Your Existing Python Project.

  1. Already Created Function ->  Created By Python Community.
  2. You Created Function or File -> You Are Created That Particular Function Or File.

1)  How To Import Already Created Function

Already Created Function is Nothing But a Function That Are Already Created By Python Community Developer. You Just Import That Particular Function And Use It.

How To Import It

import FUNCTION_NAME

You Just Write import Keyword And Write The FUNCTION_NAME That You Want To Import Them.

Example:-

import sklearn

2)  How To Import Your Created Function or File

If You Want To Import Your File, Just Write The Keyword import and Then The File Name Of That Particular File That You Want To Import That.

Example:

If There Are Two File. First File Name is Raj.py And Second File Name is Ashu.py. And You Work On Ashu.py file. and Now If You Want To Import The Raj.py File In Your Ashu.py Project. You Just Write import raj. and The Raj.py all Function Or Keyword You Can Easily Access.

import raj

raj.hello()

Thanks For Reading This Article.