Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Python Assume we have two points on a map and the coordinates of these two points are (x1,y1) and (x2,y2). Since coordinates in a map

Python image text in transcribed
image text in transcribed
image text in transcribed
Assume we have two points on a map and the coordinates of these two points are (x1,y1) and (x2,y2). Since coordinates in a map are never going to change, we are going to use tuples to save the coordinates values. Create a function compute._stat ist ics() that takes the two tuples as parameters. Your function should do the following: 1 Create a new variable x product and store the product of the first element of each tuple that is passed as a parameter 2 Create a now variable y2 average and store the average of the second element of each tuple. 3. Create a new tuple called stats that stores x. product and yaverage 4. Fetuin stats in your main program, input four floating point numbers x1,y1,x2, and y2 in that order. 1. Create two tuples to store these coordinates coord1 that atores (x1,y1) and coord2 that stores (x2, y2). (You can create a tuple by placing the carrespanding values inside the parentheses.) 2. Print the result of the function call with these tuples provided as an input. Check your code For example: If the input is: 4.3 10.4 5.0 4.8 the output is: ma...py Load defauit tainplate. 4Unit test 0/2 Check that your function returns a correct tuple compute statistics ((8,3,10.4),(5,4.8)) Namelirror: name ' 1 ' is not defined

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

Modern Database Management

Authors: Jeff Hoffer, Ramesh Venkataraman, Heikki Topi

12th edition

133544613, 978-0133544619

More Books

Students also viewed these Databases questions

Question

Q.No.1 Explain Large scale map ? Q.No.2 Explain small scale map ?

Answered: 1 week ago