CMN 152V ACTUAL FINALS QUESTIONS AND
ANSWERS SURE A+
✔✔type3 — try itWhat is the type of 0
int
float
str
bool
list - ✔✔int
✔✔booleans1 — try itWhat is the value of: not not False
True
False
not True - ✔✔false
✔✔booleans3 — try itWhich of the following does not equal True
'True'
not False
(not False)
not (not True) - ✔✔'True'
✔✔writing_strings1 — try itIn place of the ..., type 'Hi Python' - ✔✔'Hi Python'
✔✔writing_strings2 — try itIn place of the ..., type a string with the letters of the
alphabet in order, lowercase - ✔✔'abcdefghijklmnopqrstuvwxyz'
✔✔string_length1 — try itWhich string is length 5.
'hey'
'good'
,'five.'
'fifty.' - ✔✔'five.'
✔✔string_length2 — try itWhat is the length of the string 'seventy' - ✔✔7
✔✔string_length3 — try itWhat is the length of the string '' - ✔✔0
✔✔string_length4 — try itWhich string isn't length 1?
'.' # period
'"' # double quote
' ' # one space characters
' ' # two space characters
'1' # one - ✔✔' ' #two space characters
✔✔quote_types1 — try itWhich of these strings will produce an error?
',.;:/?'
'"Harriet", she said"'
"My "happiness""
"I'm, can't"
"I'm" - ✔✔"My, "happiness""
✔✔substrings_in_strings1 — try itWhich of the following is false?
'G' in 'Greetings'
"Greetings" in 'Greetings'
'in' in 'Greetings'
'sing' in 'Greetings'
'reetings' in 'Greetings' - ✔✔'sing' in 'Greetings'
✔✔substrings_in_strings2 — try itWhich of the following is false?
' ' in 'race cars are fast'
'ars a' in 'race cars are fast'
'ace' in 'race cars are fast'
'e cars' in 'race cars are fast'
'e fa' in 'race cars are fast'
'cas a' in 'race cars are fast' - ✔✔'cas a' in 'race cars are fast'
✔✔combining_strings1 — try itWhich of the following has a different output than
print('space ship')?
print('space', 'ship')
print('space' + 'ship')
print('space {}'.format( 'ship' ) )
print('{} {}'.format( 'space', 'ship' ) )
print('space{}ship'.format( ' ' ) ) - ✔✔print('space' + 'ship')
, ✔✔combining_strings2 — try itWhich of the following has a different output than print('"
"')?
print('"', '"')
print('"' + ' "')
print('"' + '"')
print('{}'.format('" "') ) - ✔✔print('"' + '"')
✔✔comparing_things1 — try itSelect the value of the expression
True == True
True
False - ✔✔true
✔✔comparing_things2 — try itSelect the value of the expression
'x' == 'X'
True
False - ✔✔false
✔✔comparing_things3 — try itSelect the value of the expression
5 + 5 == 10
True
False - ✔✔true
✔✔comparing_things4 — try itSelect the value of the expression
'5 + 5' == '10'
True
False - ✔✔false
✔✔comparing_things5 — try itSelect the value of the expression
'5' + '5' == '55'
True
False - ✔✔true
✔✔comparing_things6 — try itSelect the value of the expression
'1' == 1
True
False - ✔✔fasle
✔✔comparing_things7 — try itSelect the value of the expression
1.0 == 1
True
False - ✔✔true
✔✔comparing_things8 — try itSelect the value of the expression
ANSWERS SURE A+
✔✔type3 — try itWhat is the type of 0
int
float
str
bool
list - ✔✔int
✔✔booleans1 — try itWhat is the value of: not not False
True
False
not True - ✔✔false
✔✔booleans3 — try itWhich of the following does not equal True
'True'
not False
(not False)
not (not True) - ✔✔'True'
✔✔writing_strings1 — try itIn place of the ..., type 'Hi Python' - ✔✔'Hi Python'
✔✔writing_strings2 — try itIn place of the ..., type a string with the letters of the
alphabet in order, lowercase - ✔✔'abcdefghijklmnopqrstuvwxyz'
✔✔string_length1 — try itWhich string is length 5.
'hey'
'good'
,'five.'
'fifty.' - ✔✔'five.'
✔✔string_length2 — try itWhat is the length of the string 'seventy' - ✔✔7
✔✔string_length3 — try itWhat is the length of the string '' - ✔✔0
✔✔string_length4 — try itWhich string isn't length 1?
'.' # period
'"' # double quote
' ' # one space characters
' ' # two space characters
'1' # one - ✔✔' ' #two space characters
✔✔quote_types1 — try itWhich of these strings will produce an error?
',.;:/?'
'"Harriet", she said"'
"My "happiness""
"I'm, can't"
"I'm" - ✔✔"My, "happiness""
✔✔substrings_in_strings1 — try itWhich of the following is false?
'G' in 'Greetings'
"Greetings" in 'Greetings'
'in' in 'Greetings'
'sing' in 'Greetings'
'reetings' in 'Greetings' - ✔✔'sing' in 'Greetings'
✔✔substrings_in_strings2 — try itWhich of the following is false?
' ' in 'race cars are fast'
'ars a' in 'race cars are fast'
'ace' in 'race cars are fast'
'e cars' in 'race cars are fast'
'e fa' in 'race cars are fast'
'cas a' in 'race cars are fast' - ✔✔'cas a' in 'race cars are fast'
✔✔combining_strings1 — try itWhich of the following has a different output than
print('space ship')?
print('space', 'ship')
print('space' + 'ship')
print('space {}'.format( 'ship' ) )
print('{} {}'.format( 'space', 'ship' ) )
print('space{}ship'.format( ' ' ) ) - ✔✔print('space' + 'ship')
, ✔✔combining_strings2 — try itWhich of the following has a different output than print('"
"')?
print('"', '"')
print('"' + ' "')
print('"' + '"')
print('{}'.format('" "') ) - ✔✔print('"' + '"')
✔✔comparing_things1 — try itSelect the value of the expression
True == True
True
False - ✔✔true
✔✔comparing_things2 — try itSelect the value of the expression
'x' == 'X'
True
False - ✔✔false
✔✔comparing_things3 — try itSelect the value of the expression
5 + 5 == 10
True
False - ✔✔true
✔✔comparing_things4 — try itSelect the value of the expression
'5 + 5' == '10'
True
False - ✔✔false
✔✔comparing_things5 — try itSelect the value of the expression
'5' + '5' == '55'
True
False - ✔✔true
✔✔comparing_things6 — try itSelect the value of the expression
'1' == 1
True
False - ✔✔fasle
✔✔comparing_things7 — try itSelect the value of the expression
1.0 == 1
True
False - ✔✔true
✔✔comparing_things8 — try itSelect the value of the expression