python vocab

Card Set Information

python vocab
2013-09-22 22:38:34
computer science

first computer science test vocab review sheet. Will be tested on questions in codingbat logic 1.
Show Answers:

  1. argument
    A value provided to a function when the function is called. This value is assigned to the corresponding parameter in the function. The argument can be the result of an expression which may involve operators, operands and calls to other fruitful functions.
  2. docstring
    If the first thing in a function body is a string (or, we’ll see later, in other situations too) that is attached to the function as its __doc__ attribute.
  3. flow of execution
    The order in which statements are executed during a program run.
  4. function
    A named sequence of statements that performs some useful operation. Functions may or may not take parameters and may or may not produce a result
  5. function call
    A statement that executes a function. It consists of the name of the function followed by a list of arguments enclosed in parentheses
  6. function composition
    Using the output from one function call as the input to another.
  7. function definition
    A statement that creates a new function, specifying its name, parameters, and the statements it executes
  8. fruitful function
    A function that returns a value when it is called.
  9. function side effect
    Some impact that the function has on our program other than the return.
  10. pure function
    A function that returns a value when it is called and has no side effects.
  11. import statement
    A statement which permits functions and variables defined in another Python module to be brought into the environment of another script. To use the features of the turtle, we need to first import the turtle module.
  12. lifetime
    Variables and objects have lifetimes — they are created at some point during program execution, and will be destroyed at some time.
  13. local variable
    A variable defined inside a function. A local variable can only be used inside its function. Parameters of a function are also a special kind of local variable. The more nested a local variable is the higher the precedence for access.
  14. global variable
    A variable defined at the program level. A global variable can be used anywhere in the program and exists anywhere in the program. This is the least level of precedence when dealing with variable scope.
  15. parameter
    A name used inside a function to refer to the value which was passed to it as an argument.
  16. refactor
    A fancy word to describe reorganizing your program code, usually to make it more understandable. Typically, we have a program that is already working, then we go back to “tidy it up”. It often involves choosing better variable names, or spotting repeated patterns and moving that code into a function