CMN 152V CORRECT EXAMS QUESTIONS AND
ANSWERS SURE A+
✔✔list_contents4 — try itWhat is the output of the code below?
'dinosaur' in ['dinosaur']
True
False - ✔✔true
✔✔list_contents5 — try itWhat is the output of the code below?
'dino' in 'dinosaur'
False
True - ✔✔true
✔✔list_contents6 — try itWhat is the output of the code below?
'in' in ['dinosaur']
True
False - ✔✔false
✔✔list_contents7 — try itWhat is the output of the code below?
odds = [1, 3, 5, 7, 9] primes = [1, 3, 5, 7, 2] odds = odds[0:4] primes = primes[0:4]
primes == odds
True
False - ✔✔true
✔✔list_contents8 — try itWhat is the output of the code below?
odds = [1, 3, 5, 7, 9]
primes = [1, 2, 3, 5, 7]
odds = odds[0:1] + [2] + odds[2:4] odds == primes
True
False - ✔✔false
✔✔list_counts1 — try itWhat is the output of the code below?
, threes = [3, 3, 3, 3]
threes.count( 3 )
1
2
3
4
0
True
False - ✔✔4
✔✔list_counts2 — try itWhat is the output of the code below?
contents = 'this and that'
contents.count( ' ' )
1
2
3
4
0
True
False - ✔✔2
✔✔list_counts3 — try it
What is the output of the code below?
contents = 'this and that'
' ' in contents
1
2
3
4
0
True
False - ✔✔true
✔✔list_counts4 — try it
What is the output of the code below?
contents = 'this and that'
contents = list( contents )
contents.count( ' ' )
1
2
3
4
ANSWERS SURE A+
✔✔list_contents4 — try itWhat is the output of the code below?
'dinosaur' in ['dinosaur']
True
False - ✔✔true
✔✔list_contents5 — try itWhat is the output of the code below?
'dino' in 'dinosaur'
False
True - ✔✔true
✔✔list_contents6 — try itWhat is the output of the code below?
'in' in ['dinosaur']
True
False - ✔✔false
✔✔list_contents7 — try itWhat is the output of the code below?
odds = [1, 3, 5, 7, 9] primes = [1, 3, 5, 7, 2] odds = odds[0:4] primes = primes[0:4]
primes == odds
True
False - ✔✔true
✔✔list_contents8 — try itWhat is the output of the code below?
odds = [1, 3, 5, 7, 9]
primes = [1, 2, 3, 5, 7]
odds = odds[0:1] + [2] + odds[2:4] odds == primes
True
False - ✔✔false
✔✔list_counts1 — try itWhat is the output of the code below?
, threes = [3, 3, 3, 3]
threes.count( 3 )
1
2
3
4
0
True
False - ✔✔4
✔✔list_counts2 — try itWhat is the output of the code below?
contents = 'this and that'
contents.count( ' ' )
1
2
3
4
0
True
False - ✔✔2
✔✔list_counts3 — try it
What is the output of the code below?
contents = 'this and that'
' ' in contents
1
2
3
4
0
True
False - ✔✔true
✔✔list_counts4 — try it
What is the output of the code below?
contents = 'this and that'
contents = list( contents )
contents.count( ' ' )
1
2
3
4