Functions:
a) Why we need function?
If we want to use the block of code in same file/different file then we need to repeat/rewrite the code. This will cause duplicate code in our program and If you want to update your code then you need to update in all places
b) What is function
It is a block of code which will only runs when it is called.
c) Advantage:
i) Reusability
ii) Divide complex program into simpler ones
iii) Increases program readability
iv) Reduces chances of error
v) Modifying the program becomes easier
d) Example & Syntax
def function_name():
code
e) Global vs Local variables
Bonus:
How to get builtin function list in python
Keywords used:
def
#code_with_mrql,#python,#vscode,#linux
---- Python ----
Python Step by Step for Beginners - • Python Step by Step for Beginners
Python inbuilt(predefined) modules - • Python inbuilt modules
Python inbuilt(predefined) functions(Shorts) - • Python inbuilt functions - #shorts
Python one-liner series - • Python one-liner Series
Python packages and libraries - • Python packages and libraries
--- Javascript ---
Javascript Tips & Tricks/ One-liners - • JS Tips & Tricks / One liners - #shorts
---- Linux ----
Linux Commands(Shorts) - • Ubuntu/Linux Commands - #shorts
---- VS CODE ----
VS CODE and its Extensions - • VS CODE AND IT'S EXTENSIONS
VS CODE Tips and Tricks - • VS CODE TIPS AND TRICKS
Nesta página do site você pode assistir ao vídeo on-line Python Tutorial #21 - How to use Function in Python + Bonus in end of video duração hora minuto segundo em boa qualidade , que foi baixado pelo usuário code with mrql 13 Março 2022, compartilhe o link com seus amigos e conhecidos, no youtube este vídeo já foi visto 571 vezes e gostou 15 espectadores. Boa visualização!