M03 - Data Types Flashcards

1
Q

Method to determine what data type something is?

A

type( )

Add “” for string

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

Yes/No: Do you use thousand separators (,) in Python?

A

No

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

Declare integer variable example

A

num_ex = 1

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

Declare float variable example

A

float_ex = 73.81

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

Declare string variable example

A

candidate = “Diane”

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

Declare boolean variable example

A
did_happen = True
did_happen = False
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Variable names can:

A

-be any length
-consist of:
+upper case letters
+lower case letters
+digits(0-9)
+underscores

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

Variable Naming Considerations

A
  • 1st character cannot be a digit
  • variables are case sensitive
  • must be in snake case (snake_case)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Search keywords method

A

Type: help(“keywords”) in python command line

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