M03 - Data Types Flashcards
1
Q
Method to determine what data type something is?
A
type( )
Add “” for string
2
Q
Yes/No: Do you use thousand separators (,) in Python?
A
No
3
Q
Declare integer variable example
A
num_ex = 1
4
Q
Declare float variable example
A
float_ex = 73.81
5
Q
Declare string variable example
A
candidate = “Diane”
6
Q
Declare boolean variable example
A
did_happen = True did_happen = False
7
Q
Variable names can:
A
-be any length
-consist of:
+upper case letters
+lower case letters
+digits(0-9)
+underscores
8
Q
Variable Naming Considerations
A
- 1st character cannot be a digit
- variables are case sensitive
- must be in snake case (snake_case)
9
Q
Search keywords method
A
Type: help(“keywords”) in python command line