Lecture 15 Flashcards

(2 cards)

0
Q

Scope:

  1. What is scope?
  2. Why is scope important?
A
  1. ~scope refers to how and when an identifier (ex. Variable’s and functions) is accessible
  2. ~you and the program has a predefined way to mitigate naming collisions
    ~..
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
1
Q

Functions:

  1. What is a function?
  2. Why is a function important?
  3. When is a good time to utilize functions?
  4. How to utilize a function?
A
  1. ~a functions is a group of code that takes in some arguments (inputs) & returns a value (output)
  2. ~you can reuse the code inside the function
    ~you can reused functions
    ~..
  3. ~whenever you find yourself copy and pasting code
  4. ~
How well did you know this?
1
Not at all
2
3
4
5
Perfectly