Gabe C.

asked • 10/08/21

Python programming

I am brand new to programming and I have become very confused with an assignment I have. I am looking for some clarification or an example to help me understand how to conduct the question.


Write a complete program that prompts the user to an x and a y coordinate and draws a picture of a window with the upper left-hand corner at that x, y location.


I have drawn my window using a drawing panel module and when I run the program I can get it to output the window, but when I prompt a user for their coordinates I can't figure out how to get the image to move to the positions they are inputting.


Here is my code so far


def main():

x = int (input ( "x coordinate? " )

y = int (input ( "y coordinate? " )

window.fill_rect ( 40, 30, 50, 100, "blue" )

window.draw_rect ( 40, 30, 50, 100 )

window.draw_line ( 65, 30, 65, 130 )

window.draw_line ( 40, 80, 90, 80 )

drawing_panel ( 250, 250, "white" )

main()



1 Expert Answer

By:

Still looking for help? Get the right answer, fast.

Ask a question for free

Get a free answer to a quick problem.
Most questions answered within 4 hours.

OR

Find an Online Tutor Now

Choose an expert and meet online. No packages or subscriptions, pay only for the time you need.