Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Python multiple choice Q1 for _______A______ penup______B_______ pendown() _____

ID: 3838904 • Letter: P

Question

Python multiple choice

Q1

for _______A______

penup______B_______

pendown() ______C_______

Those are possible ans!

Notice

Suppose there are two non-empty list variables of equal length in Python called coords and sides.

The variable coords contains sub-lists of size 2, with each of these values representing an x and a y co-ordinate.

The variable sides also contains sub-lists of size 2, with each of these values representing firstly the length then the width of a rectangle.

Also assume there is also a function in Python called draw_rectangle which takes as its parameters two integers representing firstly the length then the width of a rectangle. The function then draws that rectangle using Turtle graphics functions.

Complete the following code to draw each of the rectangles represented by the length-width pairs in the list sides at the x-y co-ordinates contained at the same index in the list coords.

Q2

multiple choice

Those are possible ans!

goto(coords index) draw rectangle(sideslindex][0], sides index][1]) pair in sides for xy in coords: goto(coords[pair]) goto(xy) draw rectangle() draw rectangle(sides[0][index], sides[1][index]) draw rectangle (sides[0][0], sides[0111]) draw rectangle(sides[0], sides[11) index in range(len sides draw rectangle(sideslindex] index 11, sides index][index 1)

Explanation / Answer

Ques 1.) A = fpair in sides:

B = goto(coords[pair])

C = draw_rectangle(sides[0][index], sides[1][index])

Ques 2.)

index what answer 1 3 - 1 0 2 0 - 2 0 - 3 0 - 3 0 - 3 0 0