+ 7
Had a problem in def function!
Anybody please clear def function in Python
3 Answers
+ 6
def f_name allows you to define method/function named f_name in Python (and Ruby :)
What seems to be the problem with it?
+ 2
What about are you talking? @@
Is it about Python 'def' keyword in Python?
+ 2
def = define
# Defining a function
def my_function():
print("My function is called")
# Calling a function
my_function()
# Defining a function with parameters
def my_func(a, b):
print(a + b)
# Calling the function
my_func(2, 7)