javondailey5193 javondailey5193
  • 09-07-2020
  • Computers and Technology
contestada

Create a for loop that prompts the user to enter 3 different items, then appends them to new items list

Respuesta :

frknkrtrn
frknkrtrn frknkrtrn
  • 11-07-2020

Answer:

new_items = []

for i in range(3):

   item = input("Enter an item: ")

   new_items.append(item)

print(new_items)

Explanation:

*The code is in Python.

Create an empty list called  new_items

Create a for loop that iterates three times. Inside the loop, ask the user to enter an item. Append the item to the new_items using the append method.

When the loop is done, print the new_items

Answer Link

Otras preguntas

I dont know what it is and its for ten pointsss
I NEED HELP ASAP I'LL MARK BRAINEIST If the Moon orbited Earth twice as fast, how many high tides would occur in one day? three four one two
Explain how to estimate the product of 18.3(6.37).
How can being American be "more than a pride we inherit, it's the past we step into and how we repair it." Gorman says, "We've seen a force that would shatter o
While looking at a cell under a microscope, a scientist is able to see a biological molecule. This molecule is a nucleic acid with a ladder structure and contai
How do you graph this equation -2/3y= -6
how do plants remove CO2 from the atmosphere
Who was exiled for being against the Catholic church? LockeMontesquieu Voltaire​
Evaluate: 2x - 3y for x = 2, y = - 3
the equation -2(3h-1) =5 (2h-3) has how many solutions