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

Is a unit rate a ratio?
Shawn is cooking and accidentally grabs the pan in the wrong spot and burns his hand. shawn's ability to rapidly pull his hand away from the pan is caused by hi
p=I squared R solve for I
"The length of the desk" would result in which type(s) of data?
Find a solution to the inequality x > 6. A.11 B.4 C.6 D.2
What energy is being transferred when a tennis’s racket hits a tennis ball
Help on number 13 and I will thank u
what is the amount of differenence between DNA sequences in different species show? please help urgent
What describes the algebraic expression 15x+8
Which is the minimum sop expression for the function f(x,y,z) = (x + y')' z + (xz)' + y ? partial credit is granted for incomplete simplifications?