General Ideas Flashcards
source code > [answer] > output
interpreter
source code > [answer1] > [answer2] > executor > output
compiler, object code
shell mode
type commands directly into interpreter
program mode
use the interpreter to execute the entire source code as a whole
> > >
python interpreter prompt
runtime error
exception
values
objects, results of evaluating an expression
type conversion functions
int, str and float will attempt to change object to their type
truncation to zero
discard the decimal portion of the number…the number is closer to zero
variable
name that refers to a value
=
assignment token
==
equality token
python keywords
and as assert break class continue def del elif else except exec finally for from global if import in is lambda nonlocal not or pass raise return try while with yield True False None
statement
an instruction that the interpreter can execute (ex: assignment)
expression
combination of values, operators, variables and calls to functions (ex: len(“string”))
value is produced by…
the evaluation of an expression
ParseError
syntax error
TypeError
attempt to combine two objects that are not compatible
NameError
almost always means you used a variable before it has a value
three lines of code to use turtle graphics
import turtle
window = turtle.Screen()
slim = turtle.Turtle
Data Types
int, str, bool, float, list
six comparison operators
==, !=, >, =,
logical operators
and, or, not
escape sequences
\t (tab), \n (new line)
cursor
invisible marker
collection data types (name them)
strings, lists