Programming For Everybody (Getting Started With Python) - Home - Coursera - 5 PDF
Programming For Everybody (Getting Started With Python) - Home - Coursera - 5 PDF
1/1
point
1.
What is wrong with this Python loop:
1 n = 5
2 while n > 0 :
3 print(n)
4 print('All done')
1/1
point
2.
What does the break statement do?
1/1
point
3.
What does the continue statement do?
1/1
point
4.
https://www.coursera.org/learn/python/exam/HtpHM/chapter-5 1/3
03/05/2019 Programming for Everybody (Getting Started with Python) - Home | Coursera
1/1
point
5.
What is the iteration variable in the following Python code:
1/1
point
6.
What is a good description of the following bit of Python code?
1 zork = 0
2 for thing in [9, 41, 12, 3, 74, 15] :
3 zork = zork + thing
4 print('After', zork)
1/1
point
7.
What will the following code print out?
1 smallest_so_far = -1
2 for the_num in [9, 41, 12, 3, 74, 15] :
3 if the_num < smallest_so_far :
4 smallest_so_far = the_num
5 print(smallest_so_far)
Hint: This is a trick question and most would say this code has a bug - so read carefully
1/1
point
8.
https://www.coursera.org/learn/python/exam/HtpHM/chapter-5 2/3
03/05/2019 Programming for Everybody (Getting Started with Python) - Home | Coursera
What is a good statement to describe the is operator as used in the following if statement:
Chapter 5 10/10 points (100%)
Quiz, 10 questions
1 if smallest is None :
2 smallest = value
1/1
point
9.
Which reserved word indicates the start of an "inde nite" loop in Python?
1/1
point
10.
How many times will the body of the following loop be executed?
1 n = 0
2 while n > 0 :
3 print('Lather')
4 print('Rinse')
5 print('Dry off!')
https://www.coursera.org/learn/python/exam/HtpHM/chapter-5 3/3