Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

A Cartesian Grid has a series of lines drawn on it . Each line is defined by a list of 4 values x 1 ,

A Cartesian Grid has a series of lines drawn on it. Each line is defined by a list of 4 values x1,y1,x2,y2 where
the points (x1,y1) and (x2,y2) are the end points of the line. The lines may or may not form a closed figure.
Write a Python program to read in the number of lines, followed by a series of lines in no particular order. Given
that some of these lines may not contribute to a closed figure, determine whether or not a subset of the given
lines would form a closed figure. If they form a closed figure, also print the number of sides.
For this program, you must use only the standard Python libraries. Third-party libraries are not allowed. The
following figure illustrates the problem.
image text in transcribed

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

Pro SQL Server Wait Statistics

Authors: Enrico Van De Laar

1st Edition

1484211391, 9781484211397

More Books

Students also viewed these Databases questions

Question

How do Excel Pivot Tables handle data from non OLAP databases?

Answered: 1 week ago