What is the output of the following code?
sum = 0for value in range(1,4): if value == 2: sum = sum**2 sum += valueprint(sum)

A. 6
B. 12
C. 8
D. 16

Answer: A

Computer Science & Information Technology

You might also like to view...

What does clicking the pushpin next to each file name on the Recent Documents list do?

A) The file will remain on the Recent Documents list for one full week. B) The file will remain on the Recent Documents list indefinitely. C) The file can be "pinned" to a particular folder that you designate. D) The file is available to be "pinned" to the Quick Access Toolbar.

Computer Science & Information Technology

After installation of Windows 7, which of the following is the quickest way to bring the system up to date?

a. Install SP1, then run Windows Update. b. Install SP2, then run Windows Update. c. Run Windows Update. d. Install SP1.

Computer Science & Information Technology