This week lesson:
Function
Lesson outcome:
• Understand what is function.
• Learn to create function.
• Understand term argument(s),
and parameter(s) list.
• Understand argument can be a
value, a variable, an expression.
Function abs(parameter)
• Function abs take 1 argument and
store in 1 parameter and return 1
positive value.
B=40
Z=abs(-90)+abs(b)+abs(b-60)+20
print(Z,abs(B-100))
Function min(parameter list)
• Function min take more than 1 argument
and store in more than 1 parameter and
return 1 smallest value.
B=40
Z=min(70,20)+min(50,b,10)
print(Z,abs(B-100))
Function print(parameter list)
• Function print take 1 or more than 1
argument and store in 1 or more than 1
parameter and return NO value.
B=40
print(B)
print(“Hello”,B)