Variables, Data Types, & Python Operators Flashcards

1
Q

What are variables?

A

Variables are containers of values, and values have types. Variables can be named as anything, but there are rules.

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

What are the rules in naming variables?

A
  1. Must start with a letter or an underscore;
  2. Can have numbers, but not start with them;
  3. Must have no spaces;
  4. Must not have Python keywords; and
  5. Names are case-sensitive
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What are the data types of values?

A
  1. String — “”, str
  2. Integer — int, whole numbers
  3. Float — float, decimal numbers
  4. Boolean — bool, has two values, which are true or false
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What is a Python expression?

A

A mathematical expression with multiple operators.

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