It's about writing reusable code. I can suggest you write reusable code in a specific function in a separate python file and import this file and function too. For example, you need a function called sum in another function called "bodmas", then write the sum function in one python file, suppose that "allimports.py":
def sum(a,b):
return a+b
Now suppose your "bodmas" named function is some other python file, and then just import all the necessary functions, and you can usually call it by calling it.
from allimports import sum
def bodmas:
print(sum(1,1))
, , .
, , :
import allimports
print(allimports.sum(1,1))
from allimports import *
print(sum(1,1))
:
from allimports import sum
print(sum(1,1))