Before beginning these exercises, make sure to launch the Python IDLE application. If you are on the SunRays in the lab, go to the Start menu, choose Applications->Programming->PythonIDLE on strauss. This is an INDIVIDUAL assignment. Students must work alone. [Pre-lab exercises - This part is required but has nothing to submit.] Interpreter (shell) mode: Using Python as a calculator: In the Python Shell window, type in the number 7, then hit the Enter key. Python gives you back the number 7. This is an example of an atomic expression. We can also write compound expressions, which consist of two expressions (either atomic or compound), with an operator between them and optionally surrounded by parenthesis. Here are some examples, each conforming to the definition of "expression" by repeatedly applying the two definitions given above. Type each expression into the Python Shell window and make sure you understand the results returned by Python. 7 5 (7 + 5) ((7 + 5) - 3) (((7 + 5) - 3) * 2) (In the third expression, the operator is +, and the two arguments required by the + operator are two numbers, 7 and 5.) Type in 10 expressions of your creation. Predict the answer before hitting Enter. Script Mode: Saving your work in a Python script: It certainly would waste a lot of time if we had to re-type a series of expressions if we wanted to recompute our calculation with one changed value. Fortunately we are able to create files that contain Python code and execute them using the Python interpreter. This is called 'script mode' and is the mode that will be used almost always in this course. Create a new Python script by choosing File->New Window from the menu. Type each expression into the Python Shell window and make sure you understand the results returned by Python. print 7 print 5 print (7 + 5) print ((7 + 5) - 3) print (((7 + 5) - 3) * 2) Choose File->Save As... and save it as lab1.py. Run your new script by choosing Run->Run Module. Notice that in script mode, you must use 'print' to get answers printed. This part is required. Each student must electronically submit an answer file. Do each of the following problems in ONE file named lab1.py. Use comments to identify your student name and section number, and to separate each problem's solution: # # Problem 1 # Problem 2 . . . Note: All specified exercises are from the course textbook: Problem 1: (5 pts) Using Python’s math operations, compute the total number of seconds to run a 10 kilometer race in 43 minutes 30 seconds. Compute how many seconds are needed for each kilometer. Compute how many seconds are needed for each mile. (1 mile = 1.61km) Problem 2: (5 pts) Exercise 2.1 Can you figure out what is going on? Explain as a comment in your program. Problem 3: (5 pts) Exercise 2.3 Problem 4: (5 pts) Exercise 2.4 part (1) Extra Credit - Problem 5: (2 pts) Exercise 2.4 part (2) What to Turn In Using Sakai, submit a single file lab1.py containing all code and documentation for this assignment. Your name and section must be listed in the first line as a comment at the top of the file.