charris47 charris47
  • 19-01-2021
  • Computers and Technology
contestada

What would the following program print to the screen when run?

my_list = [7, 0, 0, "d", "n", "o", "B"]

my_list.reverse()

for thing in my_list:
print (thing)

Respuesta :

absor201
absor201 absor201
  • 19-01-2021

Answer:

The output will be:

B

o

n

d

0

0

7

Explanation:

Given code is of Python language

Let us look at the code line by line

The first line is:

my_list = [7, 0, 0, "d", "n", "o", "B"]

This line will create a list with the given elements.

my_list.reverse()

This line will reverse the sequence of the elements of the list

for thing in my_list:

print (thing)

These lines will simply print the reversed elements of the list on screen.

The output will be:

B

o

n

d

0

0

7

Answer Link

Otras preguntas

the variables x and y vary inversely with a constant variation of 7. Use the variation formula, k=xy, to find why when x=9
Describe the end behavior of the following function: F(x)=x^5-x^3+x^2
Please help right away
Your school needs ninebuses for this field trip additionally you must include $800 tip if your school spends 1829.82 how much does each bus cost
What is the value of x in the equation below 1/3 (12x - 24) equals 16 2 6 8 10
What is the equivalent to 3 over 4
It took Otis 6 hours to travel to the Grand Canyon. Along the way he took 18 minutes to get gasoline and 53 minutes to eat. How much time did Otis spend driving
Salim bought 31/4kg oranges,151/2kg pineapples and 103/4kg bananas. Find the total weight of fruits. If he used 23/4oranges ,121/4kg pineapples and 61/2kg banan
How does the Korean War demonstrate the policy of “containment?”
Please answer right away