Python Variable Names Flashcards

1
Q

A variable name must start with:

A

A letter or the underscore character

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

A variable name cannot start with:

A

A number

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

A variable name can only contain:

A

Alpha-numeric characters and underscores

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

True or False: variable names are not case-sensitive

A

False

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

How do you separate words in a variable name?

A

The underscore character

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

How do you assign multiple values to multiple variables in one line?

A

a, b, c = “Yes”, “No”, “Maybe”

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

True or False: you can assign the same value to multiple variables

A

True

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

How do you unpack a collection of values into variables?

A

fruits = [“apple”, “banana”, “cherry”]

x, y, z = fruits

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