Lecture 15 Flashcards
(2 cards)
0
Q
Scope:
- What is scope?
- Why is scope important?
A
- ~scope refers to how and when an identifier (ex. Variable’s and functions) is accessible
- ~you and the program has a predefined way to mitigate naming collisions
~..
1
Q
Functions:
- What is a function?
- Why is a function important?
- When is a good time to utilize functions?
- How to utilize a function?
A
- ~a functions is a group of code that takes in some arguments (inputs) & returns a value (output)
- ~you can reuse the code inside the function
~you can reused functions
~.. - ~whenever you find yourself copy and pasting code
- ~