Page 1 of 1

PLEASE SOLVE THIS IN PYTHON 3: 1. In this exercise, you must incorporate if-else conditional logic as well as loop (for

Posted: Fri Jul 01, 2022 5:41 am
by answerhappygod
PLEASE SOLVE THIS IN PYTHON 3:
1. In this exercise, you must incorporate if-else conditionallogic as well as loop (for or while) along with mouse interactionand keyboard input to enter numbers, into your drawing program.
2. For example, the demo program first shown in class asks auser to enter total number of shapes.
3. Using if-else logic, the program separates the region/widthinto two regions (if p.getX() , 250), then mouse click interactioncreates two different shapes (circles on the left half region, andsquares on the other half region).
4. Find a way to segment the window into 4 areas, and when auser click in each area, generate different shapes.
Example of the output:
Please Solve This In Python 3 1 In This Exercise You Must Incorporate If Else Conditional Logic As Well As Loop For 1
Please Solve This In Python 3 1 In This Exercise You Must Incorporate If Else Conditional Logic As Well As Loop For 1 (34.46 KiB) Viewed 40 times
Please Solve This In Python 3 1 In This Exercise You Must Incorporate If Else Conditional Logic As Well As Loop For 2
Please Solve This In Python 3 1 In This Exercise You Must Incorporate If Else Conditional Logic As Well As Loop For 2 (31.88 KiB) Viewed 40 times
Mouse Interaction example:
Please Solve This In Python 3 1 In This Exercise You Must Incorporate If Else Conditional Logic As Well As Loop For 3
Please Solve This In Python 3 1 In This Exercise You Must Incorporate If Else Conditional Logic As Well As Loop For 3 (61.14 KiB) Viewed 40 times
Enter max number of shapes: 10 ('pt0', 404, 19) ('pt1', 203, 120) ('pt2', 118, 245) ('pt3', 170, 416) ('pt4', 253, 286) ('pt5', 45, 100) ('pt6', 488, 192) ('pt7', 453, 385) ('pt8', 353, 189) ('pt9', 338, 72) 76 if-else conditional in
Enter max number of shapes: 16 378) ('pt0', 110, ('pt1', 90, 94) ('pt2', 150, 173) ('pt3', 63, 179) ('pt4', 182, 113) ('pt5', 139, 22) ('pt6', 391, 87). ('pt7', 454, 55) ('pt8', 342, 33) ('pt9', 363, 177) ('pt10', 394, 313) ('pt11', 84, 310) ('pt12', 248, 55) ('pt13¹, 329, 16) ('pt14', 473, 142) ('pt15', 374, 140) >>> 76 if-else conditional in graphics
from graphics import * maximumPoints = def main (): int (raw_input ("Enter maximum number of points:")) win = Graphwin ("click Fun", 700, 300) for i in range (maximumPoints): p = win.getMouse () p.draw (win) print("point" + str(i), p.getX(), p.getY()) main () >>> Enter maximum number of points:5 ('point0', 317, 69) ('point1', 199, 139) ('point2', 256, 228) ('point3', 396, 247) ('point 4¹, 483, 100) click Fun