Module Examples In Python3

1. Simple Example To Show The Use Of Modules In Python3.

1.A. Module.py.

import fun3


x=int(input("enter a value"))
y=int(input("enter b value"))
z=fun3.addition(x,y)
print("sum=",z)

1.B. fun3.py.

def addition(a,b):
    return(a+b)

2. Simple Example To Show The Use Of Modules From Different Packages In Python3.

2.A. Module2.py.

import first.com.subham.example.Funct

x=int(input("enter a value"))
y=int(input("enter b value"))
z=first.com.subham.example.Funct.addition(x,y)
print("sum=",z)

2.B. first.com.subham.example.Funct.py.

def addition(a,b):
    return(a+b)