Deadline: Tu 3/10/2015 at 7 AM
Refer to the Week 8 reading or other resources as necessary to complete this assignment.
For this part of the pre-lab, you'll use the online Python 3 tutor to build lists using append.
L = [] for i in range(3): L.append(i)Answer Question 1 in your pre-lab.
L = [] for j in range(5): L.append(j ** 2)Answer Question 2 in your pre-lab.
A = ['Jan.', 'Feb.', 'Mar.', 'Apr.', 'May', 'Jun.', 'Jul.', 'Aug.', 'Sep.', 'Oct.', 'Nov.', 'Dec'] B = [] for month in A: B.append(month)Answer Question 3 in your pre-lab. Note that there are more efficient ways to do what this code does -- this is just an example that uses append.
import math def PrintHello(): print("Hello!") # A def PrintGoodbye(): print("Goodbye!") # B def HiFive(): print("HiFive!") # C return 5 def main(): print("Calling PrintHello") # D PrintHello() print("Calling HiFive") # E value1 = HiFive() print("Result of HiFive:", value1) # F main()
Review your answers, and then click the Next button at the bottom of the Moodle quiz.
Once you do that, you should see something similar to this:
Click the Submit all and finish button. You MUST do this so that your
pre-lab can be graded! Once you have submitted your quiz, you should see
something similar to this at the top of your Moodle window. The important part is that the State shows up as Finished.