1 answer

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

Question:

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

The following Python code segment uses information supplied in a list called data_set. Each element of data_set is a triple (ie, three values), specifying certain properties for drawing a dot in Turtle. The properties r the location of the dot's centre on the Turtle canvas and a string representing the colour of the dot to be drawn. The size of the dot depends on its position. Note that include the co-ordinates of the dots must be drawn on the left hand side of the canvas. for data in data set: teldatal11, data [0]) color (data [2]) pensize (abs (data [1])/10) dot () Your task is to determine which the following are valid values for data set, in order produce such a drawing in Turtle. [I'red', -50, 5], ['blue',-100, 10], ['green', -200, 2001, ['yellow', -150, -100]] data set data_set [-50,5, 'red'], (-100,10, 'blue'], [-200, 200, 'green'], [-150, -100, 'yellow'] data set I[red, 5, -50], [blue,10,-100], [green, 200,-200], [yellow, -100, -1501] data_set [[-50, 'red', 5], [-100, blue', 101, [-200, 'green', 2001, -150, 'yellow, -10011 data_set E[5, -50, 'red'], [10, -100, 'blue'l, [200, -200, 'green'], [-100, -150, 'yellow1 data set [['red', 5, -50], ['blue',10, -100], ['green', 200,-200], ['yellow', -100,-1501

Answers

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.

.

Similar Solved Questions

1 answer
Digital logic design 1. (15 points) Minimize the following function using the K-map. f(A,B,C,D) = m(0,1,2,5,12,13,14,15)...
digital logic design 1. (15 points) Minimize the following function using the K-map. f(A,B,C,D) = m(0,1,2,5,12,13,14,15) 2. (15 Points) Plot the following function on the K-map and determine the minterm list. f(A,B,C,D) = BCD + ABC + ACD + BCD + ABC...
1 answer
Pplease explain 24. It was recently (when some of you were high school freshman :-) discovered...
pplease explain 24. It was recently (when some of you were high school freshman :-) discovered that it is possible to obtain information on fetal genotype based on the low number of fetal cells circulating in a pregnant woman's bloodstream. Assume that 1% of all cells in a pregnant woman's b...
1 answer
Solve fast please help me please Q3: The switch in the has been open a long...
solve fast please help me please Q3: The switch in the has been open a long time before closing at t=0. Find it(t) for t> 0. t=0 2k22 6k92 i13 62.5H 12V 9 mA 2.5 HF dscs English (United States)...
1 answer
PLEASE HELP ME WITH THIS TASK 3.1 (FLOWCHART) AND TASK 3.2 (SOURCE PROGRAM). THANK YOU! Given...
PLEASE HELP ME WITH THIS TASK 3.1 (FLOWCHART) AND TASK 3.2 (SOURCE PROGRAM). THANK YOU! Given below is a partially completed C program, which you will use as a start to complete the given tasks. #define SIZE 9 #include <stdio.h> int compareAndCount (int[], int[]); double averageDifference (i...
1 answer
A
Finding the length of a Ski Lift:Consult the figure below. To find the length of the spanof aproposed ski lift from A to B, surveyor measuresthe angle DAB to be 25degrees and then walks off adistance of 1000 feet to C and measures the angleACB to be 15 degrees.What is the distance fromA toB?...
1 answer
Tick all graphs that have a Hamiltonian path. Select one or more: o K212 K141 None of the graphs ...
Tick all graphs that have a Hamiltonian path. Select one or more: o K212 K141 None of the graphs have a Hamilton path. K224 KI,1.3 Tick all graphs that have a Hamiltonian path. Select one or more: o K212 K141 None of the graphs have a Hamilton path. K224 KI,1.3...
1 answer
Rafael is a carpenter who has a partial tear in his rotator cuff due to repetitive...
Rafael is a carpenter who has a partial tear in his rotator cuff due to repetitive strain fro his work tasks. During his outpatient treatment, Rafael's OTP provides him with information about strategies to decrease the strain on his shoulder. The OTP also asks Rafael to practice these techniques...
1 answer
Hi, please help to explain the problems below. For question 85, I wonder why the extraordinary...
Hi, please help to explain the problems below. For question 85, I wonder why the extraordinary loss is calculated net of tax, while the usual gain is not calculated net of tax? Thanks 85.     Sandstrom Corporation has an extraordinary loss of $200,000, an unusual gain of $140,000...
1 answer
Elite publishing Company has established Business Book Club, Inc. (BBC) a subsidiary that operates as follows:...
Elite publishing Company has established Business Book Club, Inc. (BBC) a subsidiary that operates as follows: BBC’s editors select from among recently published business books those they believe will be most interesting to business people. BBC will purchase these books in large quantities at ...
1 answer
In 2009, the world's largest pumpkin weighed 784 kilograms. An average-sized pumpkin weighs 5,000 grams. The 2009 world-record pumpkin weighs _____ kilograms more than an average-sized pumpkin? (Write your answer as a numeral.)
In 2009, the world's largest pumpkin weighed 784 kilograms. An average-sized pumpkin weighs 5,000 grams. The 2009 world-record pumpkin weighs _____ kilograms more than an average-sized pumpkin? (Write your answer as a numeral.)...
1 answer
7) Which of the following signaling mechanisms represent a correctly matched pair? (A) endocrine- neural communication...
7) Which of the following signaling mechanisms represent a correctly matched pair? (A) endocrine- neural communication (B) synaptic- intravenous communication (C) paracrine-communication with nearby, surrounding cells (D) gap junction-communication via hormones (E) receptor- substrate communication...
1 answer
The overhead costs incurred to do 100 machine setups was $200,000. Product A had 70 setups...
The overhead costs incurred to do 100 machine setups was $200,000. Product A had 70 setups and Product B had 30 setups. How much overhead should be allocated to Product A?...
1 answer
Discuss the innovations that have occurred in the area of E-commerce/M-commerce. Also, how is your company/organization...
Discuss the innovations that have occurred in the area of E-commerce/M-commerce. Also, how is your company/organization affected by them from a management perspective?...
1 answer
L = 2.4 m W = 1000 Kg Common Data: [Young’s modulus, E=210 GN/m2]  [Poisson’s ratio, ν=0.33]...
L = 2.4 m W = 1000 Kg Common Data: [Young’s modulus, E=210 GN/m2]  [Poisson’s ratio, ν=0.33] [Yield stress σ0 = 210 MN/m2 ] Figure 2 shows a schematic diagram for a telescopic crane. It consists of 2 telescopic beams, where Beam 1, length 2 m, and Beam 2, length L. Bea...