Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

PYTHON: Add a new code cell and implement a function namely average_of_two. It should act the same as the following cell. Obtaining the input from

PYTHON: Add a new code cell and implement a function namely average_of_two. It should act the same as the following cell. Obtaining the input from the user and printing of the result must still be outside of the the function. Make sure to write DOCSTRINGS for your function, including TYPE CONTRACT. Test it by running help(average_of_two).

x=float(input("Give me 1st number: "))

y=float(input("give me 2nd number: "))

average=(x+y)/2

print("The average of", x, "and", y,"is", average)

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

Database Systems Design Implementation And Management

Authors: Peter Robb,Carlos Coronel

5th Edition

061906269X, 9780619062699

More Books

Students also viewed these Databases questions