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.
2
Q
What are the rules in naming variables?
A
- Must start with a letter or an underscore;
- Can have numbers, but not start with them;
- Must have no spaces;
- Must not have Python keywords; and
- Names are case-sensitive
3
Q
What are the data types of values?
A
- String — “”, str
- Integer — int, whole numbers
- Float — float, decimal numbers
- Boolean — bool, has two values, which are true or false
4
Q
What is a Python expression?
A
A mathematical expression with multiple operators.