Menu

[solved]-Write Program Python Initializes List L Integer Entries Make Long Like Entries Arbitrary Q39032325

Write a program (Python) that initializes a list L with integerentries (make it as long as you like and the entries can bearbitrary). Ask the user for input. If the user inputs somethingthat is an element of the list, remove it from the list and printout the edited list.

L = [3, 3, 5]

input_val = int(input(“Please enter an arbitraryinteger:”))

for i in L:

if i == input_val:

L.remove(i)

print(L)

This yields [3, 5].

Why doesn’t it remove the second 3?

Expert Answer


Answer to Write a program (Python) that initializes a list L with integer entries (make it as long as you like and the entries can… . . .

OR


Leave a Reply

Your email address will not be published. Required fields are marked *