Variables for Strings Flashcards

1
Q

Because of the quotation marks, Python identifies the greeting below as a _______ (1 word, lowercase)

A

string

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

Because there are no quotation marks, Python identifies the set of characters below as a _______.

A

variable

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

Assign the string “Boo!” to the variable scare.

A

scare = “Boo!”

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

Assign the string “jay” to the variable bird.

A

bird = “jay”

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

Assign your first name to a variable. You choose the variable name.

A

my_name = “Mark”

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

Assign a string to a variable. You choose the variable name and the string.

A

gender = “male”

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

In the statement below, I assign a string to a variable. Using the variable, write the statement that displays the string on the screen.
my_name = “Mark”

A

print(my_name)

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

Assign a string to a variable. You choose the variable name and the string. Using the variable, write a statement that displays the string on the screen.

A

city = “London”

print(city)

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

Revise this variable name as the Python governing body recommends.
countryoforigin

A

country_of_origin

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

Assign the string “Hi” to the variable greeting

A

greeting = “Hi”

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