Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Exercise 1 Step 1: Launch Wing 101. Step 2: Click Wing's Create a new file button (the leftmost button in the toolbar - it looks
Exercise 1 Step 1: Launch Wing 101. Step 2: Click Wing's Create a new file button (the leftmost button in the toolbar - it looks like a piece of paper) or select File > New from the menu bar. A new editor window, labelled untitled-1.py, will appear. Step 3: From the menu bar, select File > Save As... A "Save Document As" dialogue box will appear. Navigate to the folder where you want to store the file, then type lab3ex1.py in the File name: box. Click Save. Wing will create a new file named lab3ex1.py. Step 4: In the editor window, type this code (which you used in Part 1): import math def area_of_disk(radius): return math.pi * radius ** 2 def area_of_ring (outer, inner): return area_of_disk(outer) area_of_disk(inner) Don't copy/paste code from PDF files into the Wing 101 editor. Doing this may transfer non-displayable characters that Python doesn't recognize, triggering errors when you save the file or run the code. Because these characters aren't shown on the screen, locating them and removing them from the source code can be tedious. After you've edited the code, save it in lab3ex1.py. To do this, click the Save button in the toolbar (it looks like a 3.5-inch floppy disk) or select File > Save from the menu bar. Step 5: Click the Run button (the green triangle in the toolbar). This will load lab3ex1.py into the Python interpreter and check it for syntax errors. If any syntax errors are reported, edit the function to correct the errors, save the edited file, then click Run. Step 6: Interactively test the functions by typing these call expressions (function calls) in the shell. Python will display the value that each function call returns; that is, the value of the call expression. >>> area_of_disk(5) >>> area_of_disk(5.0) >>> area_of_ring(10, 5) >>> area_of_ring(10.0, 5.0) Step 7: Select File > Close from the menu bar. The editor window will no longer be displayed. (You can click the Open a file button on the toolbar - it looks like an open file folder - or select File > Open... from the menu bar if you want to reopen the file.)
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started