Question
(PYTHON)Write a turtle graphics program that given 2 sets of coordinates will draw a complete bipartite graph. In a complete bipartite graph, lines connect all
(PYTHON)Write a turtle graphics program that given 2 sets of coordinates will draw a complete bipartite graph. In a complete bipartite graph, lines connect all the points in one set with all the points in the other set. In the following example, there are lines connecting all the dots on the left with all the dots on the right. Note that this is yet another case where you need to get all combinations of items in 2 sets -- you should know a general way to do this.
Test your program using the following 2 lists of X and Y coordinates:
coord_list_1 = [[-200,200],[-200,90],[-50,-20]]
coord_list_2 = [[50,200],[50,170],[300,90],[50,30],[50,0],[50,-13],[50,-73]]
It is suggested that you use the turtle.setposition(X,Y) method to draw each line
The graph should look approximately like the following image (this drawing uses the sample coordinate lists):
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started