Not actually related to modules

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

def sub (a, b):
return a-b

def mul(a, b):
return a*b

def div(a, b):
return a//b

def square(a, b):
return (a+b) ** 2

if name == ‘main’:
print(“Hello Wolrd!!”)
print(add(13325, 350))
a = int(input())

b = int(input())

print(int(sum(24.50, 85.36)))

print(add(a, b))

this is the module I created and codes under the if block
I mean codes under the if name == 'main": block will get executed only when we are executing the module or the file as python script not while importing that into another module… but what’s wrong in my code I actually having an error while executing the last two lines of my code…

though you have created a custom sum function , but still python is understanding that call as of the default function in python.
and that sum function doesn’t take two arguments , it takes one argument and that should also be an iterable , hence you are getting that error.

1 Like

Thanx a lot prashant … It really helps…

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.