Search for notes by fellow students, in your own course and all over the country.
Browse our notes for titles which look like what you need, you can preview any of the notes via a sample of the contents. After you're happy these are the notes you're after simply pop them into your shopping cart.
Document Preview
Extracts from the notes are below, to see the PDF you'll receive please use the links above
Delwin Thermitus
Cyber Security
Functions
-
Define Math Functions
Define String Functions
Utilize the basics of primitive data types, control flow, and functional programming
Define a Function w/ multiple parameters
Call their own Functions
Return Data from their Functions
Work w/ returned Data
Data
-
Functions
o Purpose
▪ Recipe of code
▪ Used for modularity
▪ Used for expandability
▪ Single – responsibility principle
o In Python we use the ‘def’ keyword to define a function block
o We follow that keyword w/ the name of the functions we are trying to define
o Then we, in Parenthesis, define what parameters(ingredients) or
Functions(Recipe) will need
...
These are called arguments
- We can execute a function by using the function name and using parenthesis including
the arguments to be passed to the function
Definition:
Def adder(num1, num2)
Print(num1 + num2)
Adder(4,5)
Execution:
Execution context
- It will pause execution of current work and ‘bookmark’ this position to return to after
the completion of the function
- All variables, used w in a Functions will, by default, be unavailable after complete of the
function
Returning Data
- To return a result from a function so that it can be continued to be used elsewhere we
will use the return keyboard
...
If we want to receive a result from a function sent back to the position from which it
was called, we can do so with the return keyword