Which statement correctly creates a set named rainbow that contains the 7 colors in a rainbow?

A. colors = ["red", "orange", "yellow", "green", "blue", "indigo", "violet"]
rainbow = set(colors)

B. colors = {red, orange, yellow, green, blue, indigo, violet}
rainbow = colors

C. colors = {red, orange, yellow, green, blue, indigo, violet}
rainbow = colors

D. colors = {"red", "orange", "yellow", "green", "blue", "indigo", "violet"}
rainbow = colors.set


Answer: A. colors = ["red", "orange", "yellow", "green", "blue", "indigo", "violet"]
rainbow = set(colors)

Computer Science & Information Technology

You might also like to view...

The clone method return type is:

a. the same as the cloned object b. Object c. String d. none of the above

Computer Science & Information Technology

Lamport’s Bakery Algorithm does not require ________.

a) a large number of shared variables b) complicated loops c) that any operations occur atomically d) all of the above

Computer Science & Information Technology

Instant Messaging is one of the least common ways that malicious code is spread on the Internet.

Answer the following statement true (T) or false (F)

Computer Science & Information Technology

A(n) ____ is a computer used to host programs and data for a network.

A. mainframe computer B. super server C. midrange server D. Internet server

Computer Science & Information Technology