CS 170 Exam One Terms and Concepts
Basic Computer Concepts
- hardware components: main memory, secondary memory, central
processing unit (CPU)
- main memory: random-access memory (RAM), address
- kinds of values stored in memory: integers, real numbers
(floats), characters (using ASCII/Unicode), strings, program instructions
- secondary memory: hard disk, floppy disk, CD, flash drive
- programming languages: machine language, assembly language,
high-level languages, syntax vs. semantics
Python Statements
- Python: variables, program statements, assignment
statements (how they are different from algebra), print statements,
input statements, numeric expressions
(operators such as +, -, *, /, //, % and **) and precedence,
importance of comments
Functions
- functions: how to define a function, parameter passing,
returning a value from a function, how to call a function, local
variables in a function
Repetition
- for loops: using for loops to achieve repetition, syntax of
for loops, how indenting is important to indicate what happens
inside vs. outside of loops
- range function: how the range function works, what it
returns for different inputs, how to use it to create the sequences
that you want, how it interacts with for loops
- accumulation pattern: using for loops to accumulate value
in a variable, sums as well as products, initializing the
accumulation variable, using += or *= or just var = var + whatever
to increment the accumulation variable