Professional Documents
Culture Documents
Introduction
In each lab you will work through a series of exercises that will help you to
reinforce your learning by applying and using the knowledge gained in the
lecture class.
Remember - you are not expected to remember everything from your memory
– you may do a little research / reading of materials from the MIT resources
available. You have to prepare yourself for the lab as much as possible before
the lab session.
Submission Due: End of laboratory class, submit the file on Moodle at least 10
minutes before the end of laboratory class even if you have not completed all
the given exercises.
1)
2)
Consider the following code segment:
count = 5
while count > 1:
print(count, end = " ")
count -= 1
3)
Consider the following code segment:
theSum = 0.0
while True:
number = input("Enter a number: ")
if number == "":
break
theSum += float(number)