binary numbers
changing a variables value
assigning values to multiple variables
this is a shortcut modulus
returns 7, remainder of clock arithmetic properly evaluating equality of floating points
|
algorithm for base conversion
in general, given a base b and a decimal number n, repeat the following until the number is 0 divide n by b and prepend the remainder of the division let the new number be n divided by b, rounded down the life of an objectcreation manipulation (while it exists) stops existing when there are no more references to it swapping values
temp_var stores x = 137 then you take x = y, moves both to 42 then define y as temp_var, 137 y = 137 prevents loss of information input function always returnsa string! |
type error
can't multiply between two strings must cast string as int object references
= Is not equality, not commutativex = 7 7 = x illegal in pyton |
Cheatography
https://cheatography.com
COMP 202 Cheat Sheet (DRAFT) by daisz
for programming class
This is a draft cheat sheet. It is a work in progress and is not finished yet.