2 Simple Data Flashcards
Assignment Token
=
Reference Diagram
State Snapshot
State Snapshot
Reference Diagram
Variable naming rules
Technically can be LC letter or underscore, NO #s
Keywords
and, as, not, etc.
Statement
An instruction that an interpreter can execute
An instruction that an interpreter can execute
Statement
Expression
Combo of vals, vars, ops, and funct calls that must be evaluated; produces a value.
Combo of vals, vars, ops, and funct calls that must be evaluated; produces a value.
Expression
Statement vs. Expression–which one returns?
Expression
% Name
Modulo
Return rightmost digit trick
x % 10
x divisible by y trick
if x % y = 0, x is divisible by y
Input code
input(“prompt “)
Which bastard evaluates R-L?
**
Incrementing by 1
Bumping
Bumping
Incrementing by 1
Comment in/out trick in PyCharm
Ctrl-/
Swapping values between vars trick
a, b = b, a
2.0 + 1 = ?
3.0
How to span multiple lines?
Triple quotes
New line character
\n