Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

please show me step 3 and 4 Exercise 1 Step 1: Launch Wing 101. Create a new editor window and save it. Use lab4ex1.py as

please show me step 3 and 4
image text in transcribed
Exercise 1 Step 1: Launch Wing 101. Create a new editor window and save it. Use lab4ex1.py as the file name. Step 2: Here is the definition of function area_of_disk, which returns the area of a circle with a non-negative radius. (It should look familiar - you used it in Lab 3.) import math def area_of_disk(radius): return math.pi * radius ** 2 Type the code in the editor window. (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.) Save the code, then click Run. Correct any syntax errors. Step 3: Add type annotations to the function header. Add a documentation string to the function definition. The docstring must include a sentence or two that describes what the function does (but not how it does it). Mention the function parameter in your description and describe the return value. (For examples of what we expect a docstring to contain, review last week's lecture materials and Practical Programming, section Designing New Functions: A Recipe, pp. 47-49.) Below the description, type two or three example function calls and the return values we'd expect to see in the Python shell. Save the code, then click Run. Correct any syntax errors. Step 4: Use the Python shell to test your function. After you've finished testing, close the editor window for lab4ex1.py

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Databases Demystified

Authors: Andrew Oppel

1st Edition

0072253649, 9780072253641

More Books

Students also viewed these Databases questions

Question

How do Dimensional Database Models differ from Relational Models?

Answered: 1 week ago

Question

What type of processing do Relational Databases support?

Answered: 1 week ago

Question

Describe several aggregation operators.

Answered: 1 week ago