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

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899603
Joined: Mon Aug 02, 2021 8:13 am

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

Post 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 clickinteraction creates two different shapes (circles on the left halfregion, and squares 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 (31.78 KiB) Viewed 39 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 2
Please Solve This In Python 3 1 In This Exercise You Must Incorporate If Else Conditional Logic As Well As Loop For 2 (60.8 KiB) Viewed 39 times
Enter max number of shapes: 16. ('pt0', 110, 378) ('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) >>> 74 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) ('point 3', 396, 247) ('point4', 483, 100) 776 click Fun
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply