0% found this document useful (0 votes)
38 views

Function Additional Notes

This lesson covers functions in Python including: understanding what a function is; creating functions; and understanding terms like arguments, parameters, and that arguments can be values, variables, or expressions. It provides examples of the abs(), min(), and print() functions - abs() returns the absolute value of a number, min() returns the smallest value from multiple arguments, and print() displays output but returns no value.

Uploaded by

Nur Fatin Emilia
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
38 views

Function Additional Notes

This lesson covers functions in Python including: understanding what a function is; creating functions; and understanding terms like arguments, parameters, and that arguments can be values, variables, or expressions. It provides examples of the abs(), min(), and print() functions - abs() returns the absolute value of a number, min() returns the smallest value from multiple arguments, and print() displays output but returns no value.

Uploaded by

Nur Fatin Emilia
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 5

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)

You might also like