I'm really new to Python, and I'm trying to write a python program that asks the user how many pieces of data they have, and then the user inputs that data which goes into an array. The problem I'm running into is that I must define the length of the array for the program to work, but I want the user to define that as "x". That way, the user can put a specific amount of data into the array.
Here's what I have
i = 0
x = int(input("How many iterations"))
odds = [] #This is where I do not know how to define the array as whatever amount of pieces of data the user wants.
while i < x:
odds[i] = input("Enter number ")
i = i+1
The error message says
IndexError: list assignment index out of range
I'm pretty new to programming, so any help would be much appreciated. I totally understand that I may be going about this problem TOTALLY the wrong way, so please let me know how you would do it. Thanks!