Python Basics Flashcards
Declarative Knowledge
A statement of fact
it does not tell you have to do stuff
Imperative Knowledge
A recipe or “how-to”
(this tells you how to do something)
Also know as an algorithm
What is a recipe?
1) A sequence of simple steps
2) Flow of control that specifies when each step is executed
3) Determining when to stop
Syntax
Is passing of a sentence/string
Static semantics
Is which syntactically valid strings have meaning
Semantics
Is the meaning associated with syntactically correct string of symbols with no static semantic errors
Program
Is a sequence of definitions and commands
- definitions are evaluated
- commands are executed
Commands
Statements - instruct interpreter to do something
Data objects
is what the program is manipulating
Objects are
scalar (cannot be subdivided)
non-scalar (have internal structure that can be accessed)
Object type
defines what the programs can do to them
Scalar objects in Python
- Integers (int)
- Real numbers (float)
- Boolean (bool)
- Special (NoneType)
cast
convert objects of one type to another
combine objects and operators
operator precedence without parentheses
** * / \+ and - execute left to right parentheses always have top priority and get done first and will be evaluated inside out.