Question

The following Python code segment uses information supplied in a list called data_set. Each element of data_set is a triple (

0 0
Add a comment Improve this question Transcribed image text
Answer #1

Answer :

In this python code, we uses information supplied in a list called data_set. Each element of data_set is a triple which specifying certain properties for drawing a dot in turtle.

So, the valid values for data_set out of the following data_set is

data_set=[[-50,5,'red'],[-100,10,'blue'],[-200,200,'green'],[-150,-100,'yellow']]

because

(1) If we look at the code , it is given that data[2] store color value .So, data_set third value must store color value .

That why option 1,3,4,6 is not a valid data_set as color value is not always stored in data[2].

Now , we have two option left that is option 2 and 5 where data[2] contain color value.

(2) As it is given in the question that all dot must be done on the left hand side of the canvas that why data[0] will always have negative value and data[1] values can have positive or negative value.

Hence option 2 is the valid data_set for the given python code.

Add a comment
Know the answer?
Add Answer to:
The following Python code segment uses information supplied in a list called data_set. Each element of...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT