This is a text field

Import the module or File

module is the current file telling python to do the work of stored file in current file.

So,basically why we have to import the file ?

If there is large program so with help of module we can break in small files.

pizza.py

def make_pizza(
size,*toopings
):
""" make_pizza
function give
information about
size and toppings"""

print("The size of
toppings is
"+str(size)
+"!")
for topping in
toopings :
print(tooping)

Create new file im.py

im.py

import pizza

pizza.make_pizza(16,
"mushroom",
"peporoni")

Output:

The size of toppings is:
16

mushroom
peporoni

Avatar for Vipul kunwar
Follow me

    Leave a Reply

    Your email address will not be published. Required fields are marked *

    Back to top