List out the types of function ( 2 )
What should we add when creating a function?
What is a function?
How can we call / invoke the function ?
What should we do when we are adding code to the function body?
Will the function be executed like this?
def print_lyrics():
print (“I’m a lumberjack, and I’m okay. “)
What is void functions also called as?
What is a fruitful function?
Come out an example of the pesudocode of function
Start
Prompt user for N
Read N
Call AVRG(10,5,N)
End
Function AVRG(n1,n2,n3)
Calculate sum = n1 +n2 + n3
Calculate result = sum/3
Print result
EndFunction
What does the return statements do?
Come out an example of the pesudocode of function ( with return value )
Start
Prompt user for N
Read N
Call AVRG(10,5,N) returning average
Print average
End
Function AVRG(n1,n2,n3)
Calculate sum = n1 +n2 + n3
Calculate result = sum/3
return result
EndFunction
What is an arguments?
When we put arguments?
Why should we use arguments?
greet(“Hello”#This is arguments )
What is a parameter?
def greet(message # This is parameter )
Can we define more than one parameter in function ?
Do we need to match the number and order of arguments and parameters
What are function with return value ?
What are the keywords used in functions that have return value?