How To Create Module in Python

Hi there,

I am working on creating local modules in my python. However, when I was importing the module Python gave me a syntax error as shown in the picture. Could anyone please advise?

Very respectfully,

Long

1 Like

the .py file should not start with Python 3.8. ..., and without the >>>

It should look more like

def add ...
    ...
    

def multi ...
    ...
2 Likes

Hi Mariatta,
Thank you for your response. I just learnt that I should use Interactive Mode to write down module’s function. Have a great day!
Best,
Long

1 Like