Learn practical skills, build real-world projects, and advance your career
Created 2 years ago
Function Arguments
def greet(name, msg):
"""
This function greets to person with the provided message
"""
print("Hello {0} , {1}".format(name, msg))
#call the function with arguments
greet("satish", "Good Morning")
Hello satish , Good Morning
#suppose if we pass one argument
greet("satish") #will get an error
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
<ipython-input-3-b48ea98044bf> in <module>()
1 #suppose if we pass one argument
2
----> 3 greet("satish") #will get an error
TypeError: greet() missing 1 required positional argument: 'msg'