+ 2

How does "def" work in python?

Well I have seen "def" in lots of programs but I never understood the function. I am a newbie in python so I need a basic explanation about "def".And I would be really happy if you can add a basic explanation too. Thank you for your attention :)

2nd Sep 2017, 1:21 PM
Çağdaş Sorgun
Çağdaş Sorgun - avatar
2 Respuestas
+ 14
Python >>>help("def")
2nd Sep 2017, 1:45 PM
༼ つ ◕_◕ ༽つ
༼ つ ◕_◕ ༽つ - avatar
+ 9
"def" is used to declare a function..Like :- def functionname(): #function content here Without it you cannot start a function. It is then followed by the function name and parentheses
2nd Sep 2017, 1:26 PM
Nikhil
Nikhil - avatar