1/17
Vocabulary flashcards covering IPO, variables, Python basics, operators, conditionals, functions, and grading concepts from the notes.
Name | Mastery | Learn | Test | Matching | Spaced |
---|
No study sessions yet.
IPO
Stands for Input, Process, Output: a model of how data flows through a program (input data, process it, then output results).
Variable attributes
Three main attributes: name (identifier), type (data type), and value (current data stored).
SEP
Separator string inserted between printed values (default is a space). (Can be used in replacement for the default spacing in comma's)
END
String appended at the end of the print output (default is a newline).
Arithmetic Operator precedence
Rules for the order of operations; (),**, left to right *,%,//,/ then +, -
MOD
%, returns the remainder of division; e.g., 55 % 3 = 1.
Floor division
//, division that discards fractional part; e.g., 55 // 3 = 18.
Exponentiation
**, raises a number to a power; e.g., 2 ** 3 = 8.
Comment out
Line comments start with # and are ignored by the interpreter.
Conditional patterns (3 kinds)
Simple if, if-else, and if-elif-else chains.
Relational operator
Operators that compare values: <, <=, >, >=, ==, != (yield booleans).
Logical operator
and, or, not; combine boolean expressions.
Boolean expressions
Expressions that evaluate to True or False.
Function return vs arguments vs variables (correspondence)
When unpacking a function's return, the number of items returned should match the number of variables receiving them.
Must all functions take arguments?
No. Functions can have zero parameters.
Must all functions return values?
No. Some functions return nothing (None).
Naming parameters vs arguments
Parameter names can be the same as argument values; parameters are names in a function definition, arguments are values passed in a call. (Yes they can be named the same)
Statement about parameters vs arguments (true/false)
True: Parameters appear in a function definition and arguments appear in a function call.