130k views
2 votes
Need help with coding.

I'm trying to input a list that uses int(input("Element: ")) and it's causing an error. Anything to help with this?

User Grmartin
by
4.6k points

1 Answer

2 votes

You could try something likes this.

lst = []

n = int(input("Number of elements: ))

for i in range(0, n):

element = int(input("Element: "))

lst.append(element)

User Sigil
by
4.8k points