Basics of Python and Tokens Flashcards
What are the 6 basics of Python?
- Variables and data types
- Operators
- Control flow
- Functions
- Modules
- OOP
What are the 7 data types?
- Numbers/numerics
- Strings
- Lists
- Tuples
- Dictionaries
- Sets
- Booleans
What are the ordered data types?
- Numerics
- Strings
- Lists
- Tuples
What are the unordered data types?
- Dictionaries
- Sets
It is a scalar/primitive data type.
Booleans.
Lists are an ordered collection as well as a __ collection.
sequence
Tuples are __ collections and are __.
ordered, immutable
Dictionaries are __ collections of __-__ pairs.
unordered, key value
Give an example of a key-value pair.
“Name: “ “Alice”
Sets are __ collections of __ elements.
unordered, unique
What values are in a boolean?
True or false.
The 3 operators.
- Arithmetic
- Comparison
- Logic
3 examples of arithmetic operators.
- //
- %
- **
What does the arithmetic operator // do?
It takes the greatest integer of a quotient.
What does the arithmetic operator % do?
It takes the remainder of a quotient.
What does the arithmetic operator ** do?
It indicates an exponent.
== is a __ operator used in __ operations.
comparison, conditional
Give 3 examples of logic operators.
- And
- Or
- Not
Give 4 examples of control flow functions.
- if-else statements
- for loops
- while loops
- break and continue