Which statement describes the punctuation conventions used for character data in
Python?
a. When you initialize or assign a character literal to a variable, the convention is to
surround the literal with double quotes.
b. When you initialize or assign a character literal to a variable, you are not allowed to
use single quotes.
c. When you initialize or assign a character literal to a variable, the convention is to
surround the literal with asterisks.
d. When you initialize or assign a character literal to a variable, the convention is to
simply place the literal value after the equals sign.
,Give this one a try later!
a. When you initialize or assign a character literal to a variable, the
convention is to surround the literal with double quotes.
What would be displayed by the following code sequence?
a = [1, 2, 3]
b=a
a.append(4)
b.append(4)
print(b)
a. [4, 1, 2, 3]
b. [1 2, 3, 4]
c. [1, 2, 3, 4, 4]
d. [1, 2, 3]
Give this one a try later!
c. [1, 2, 3, 4, 4]
Suppose you create a Python list containing the elements "J", "A", "W", "S", and 3, in that
order. What are the index values of the first and last elements of this list?
a. 1 and 5
b. 0 and 3
c. 0 and 4
d. 1 and 3
Give this one a try later!
, c. 0 and 4
The primary difference between / and // in Python 3 is that
a. / depends on the values computed upon; // does not
b. // always results in an integer; / may result in fractions or decimals
c. / gives a quotient and // gives a remainder
Give this one a try later!
b. // always results in an integer; / may result in fractions or decimals
Which statement should you place in the blank of the following Python code if you
want to add an assignment statement that changes the value of the variable
apple_pies?
apple_pies = 4
_____
a. apple_pies = apple_pies + 2
b. lemon_pies = apple_pies + 2
c. pies = "apple pies"
d. apple_pies(5)
Give this one a try later!
a. apple_pies = apple_pies + 2
When using IDLE, you choose shell mode _____.
a. in order to save your work for future use
b. by saving your file and then pressing F5
Python?
a. When you initialize or assign a character literal to a variable, the convention is to
surround the literal with double quotes.
b. When you initialize or assign a character literal to a variable, you are not allowed to
use single quotes.
c. When you initialize or assign a character literal to a variable, the convention is to
surround the literal with asterisks.
d. When you initialize or assign a character literal to a variable, the convention is to
simply place the literal value after the equals sign.
,Give this one a try later!
a. When you initialize or assign a character literal to a variable, the
convention is to surround the literal with double quotes.
What would be displayed by the following code sequence?
a = [1, 2, 3]
b=a
a.append(4)
b.append(4)
print(b)
a. [4, 1, 2, 3]
b. [1 2, 3, 4]
c. [1, 2, 3, 4, 4]
d. [1, 2, 3]
Give this one a try later!
c. [1, 2, 3, 4, 4]
Suppose you create a Python list containing the elements "J", "A", "W", "S", and 3, in that
order. What are the index values of the first and last elements of this list?
a. 1 and 5
b. 0 and 3
c. 0 and 4
d. 1 and 3
Give this one a try later!
, c. 0 and 4
The primary difference between / and // in Python 3 is that
a. / depends on the values computed upon; // does not
b. // always results in an integer; / may result in fractions or decimals
c. / gives a quotient and // gives a remainder
Give this one a try later!
b. // always results in an integer; / may result in fractions or decimals
Which statement should you place in the blank of the following Python code if you
want to add an assignment statement that changes the value of the variable
apple_pies?
apple_pies = 4
_____
a. apple_pies = apple_pies + 2
b. lemon_pies = apple_pies + 2
c. pies = "apple pies"
d. apple_pies(5)
Give this one a try later!
a. apple_pies = apple_pies + 2
When using IDLE, you choose shell mode _____.
a. in order to save your work for future use
b. by saving your file and then pressing F5