Variables and Expressions Flashcards

1
Q

what are variables?

A

variables are a way of giving names to data so that the computer can remember the data

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

what constraints must variable names follow in Python?

A
  • 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
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

what is variable assignment?

A

the process of giving a valid name to a piece of data

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

what are expressions?

A

combinations of data and operators

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

what are operators?

A

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

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

what three distinct components of a computer program does the Model-View-Controller pattern emphasize?

A
  • 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
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

what are local variables used for?

A

to store intermediate values

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

what are global values used for?

A

to store persistent values (values that are relevant to multiple parts of our program)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly