+ 6
What a function
huh
11 Answers
+ 13
A function is a block of code that can be called multiple times..
For instance, you have a function that will add 2 numbers..
Def add(x,y):
return x+y
Now I can call the add() function and give it 2 numbers. It will return them as many times as I want, instead of having to code it over and over..
print(add(3,5))
print(add(8,5))
print(add(2,4))
Output:
8
13
6
+ 6
Oh you mean what is a function? Love the huh tag. See answer by Amanda Wertz .
+ 3
Function is a block of code
+ 2
Can you give me an example like a piece of code
+ 2
I know all this answers are complicated....đ
Just remeber....fuction is any constant block or part of code which may or may not accept any value for performing a certain task when it is called in the main fuction....
I think you understant now
+ 1
also called subroutines or procedures. Functions are used to utilize code in more than one place in a program. The only way without functions to reuse code consists in copying the code
so instead of copying code lots of times to do something, we write the function and just tell it to work lots of times.
say you had one that turns all letters to CAPITALS anytime you want to do that you tell that function to do so.
can throw loads of letters at it from anywhere in the program as the functions programmed to handle it
+ 1
Ohhh thx ok
+ 1
Amanda Wertz answer very well and complete
+ 1
A function is a working flow, how the system will work, how the coding will perform on user needs.
+ 1
Thx
+ 1
Yeah I kinda do thank you anyway đđ