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
Get step-by-step solutions from verified subject matter experts
