Question: *Python* so I have an input.txt file like this: 4 1.183285674283265 -1.4429089651671336 2.60408271068193 1.7100364614313503 -1.394908814267033 -2.1859795541188804 1.512434761389667 1.1772693856807423 -2.704895939322301 -1.48157465754987444 3.89304832367849 2.0341836800222448 where 4 is

*Python* so I have an input.txt file like this:

4 1.183285674283265 -1.4429089651671336 2.60408271068193 1.7100364614313503 -1.394908814267033 -2.1859795541188804 1.512434761389667 1.1772693856807423 -2.704895939322301 -1.48157465754987444 3.89304832367849 2.0341836800222448

where 4 is an int value and the float values represent a line segment. The line segment will be of the form (x1, y1) to (x2, y2), where each line holds the values in order x1y1x2y2.

I just need help writing a function that takes those floating point numbers from the input.txt file and assign them to (x1,y1) (x2,y2)

Thank you in advance!

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!