python: in put lists from keyboard

Solution 1:

You initialized list1 to an empty list

list1 = []

In order to add a new item to the end of the list use append()

for i in range(0,6):
   list1.append(input("enter a integer of list1:"))

In your example

for i in range(0,6):
   list1[i] = input("enter a integer of list1:")

You were getting an IndexError because you were trying to access an index in list1 that doesnt exist, since the length of an empty list is zero.

(FYI this answer is specific to your error, not the rest of your code)

Docs:https://docs.python.org/3/tutorial/datastructures.html