Midterm Flashcards
Learn for midterm
Define:
Int
Float
Type
Int is an integer
Float is a decimal point
Type is for datatypd
Operator vs operand
Does programming follow operator precedence
Operators are +, ×, ÷, etc
Operands are numbers
Yes it follows operator precedencd
Define:
**
/
//
\
** is to the power
/ is float division
// is integer division
\ is line continuation
Decimal vs binary
Decimal is base 10
Binary is base 2
Base 2 vs base 10
Base10 is decimal
Base 2 is binary
() [] {} >>> #
() are parentheses [] are brakets {} are braces >>> is a prompt # is a comment
Syntax error vs semantic error
Syntaxes error: type smt that is not valid
Semantic error: you tell python to do smt it can’t do
Why do software updates occur?
- New features were added
2. Bugs were fixed
How many symbols does base 10 and base 2 have?
Base 10 has 10 symbols
Base 2 has 2 symbols
Which is positive and negative?
0 is positive
1 is negative
8 bits is a ____
4 bits is a___
8 is a byte
4 is a nibble
How is data stored I a computer?
Data is stored in binary digits (bits) I fixed-size cells
How to do binary to decimal?
5432
5x2^3 +4×2^2 + 3×2^1 +2×2^0 = all added up
What numbers do cells contain?
Patterns of 0 and 1. So if we add 1+1 it gets added up to 0 and the 1 gets carried
Define
EOL
len()
Ord()
EOL is end of line
Len() is length of a string that can be added and multiplied.
Ord() converts characters to numbers
Which one is a space and which one of not a space?
+ is no space
, is a space
FDR
- Examples
- Header
- Description
- Body
- Test
What is a string?
A sequences of characters, digits and symbols. String always has ‘’ around the string.