I\'m just learning python and confused when a \"def\" of a function ends?
I see code samples like:
def myfunc(a=4,b=6):
sum = a + b
return su
It uses indentation
def func():
funcbody
if cond:
ifbody
outofif
outof_func
So its the indentation that matters. As other users here have pointed out to you, when the indentation level is at the same point as the def function declaration your function has ended. Keep in mind that you cannot mix tabs and spaces in Python. Most editors provide support for this.