Variables and Expressions Flashcards
what are variables?
variables are a way of giving names to data so that the computer can remember the data
what constraints must variable names follow in Python?
- may contain letters of digits, but cannot start with a digit
- may contain underscore characters and may start with an underscore
- may not contain spaces or other special characters
what is variable assignment?
the process of giving a valid name to a piece of data
what are expressions?
combinations of data and operators
what are operators?
special symbols which have specific meaning in the programming language. they perform computations on one or more pieces of data to produce a new piece of data
what three distinct components of a computer program does the Model-View-Controller pattern emphasize?
- the model is the computer’s internal representation of a problem or environment
- a view is a method of displaying the program’s model to a human user
- a controller is a method for a human user to modify the model
what are local variables used for?
to store intermediate values
what are global values used for?
to store persistent values (values that are relevant to multiple parts of our program)