I'm trying to add only the prime numbers from my first list into a second list.
I'm not receiving any output.
li1= [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
li2=[]
def is_primeList(lst):
pos = 2
for i in range(len(lst)):
x = True
if(i<2):
x = False
for j in range(2, i):
if i% j == 0:
x = False
break
if x:
li2.insert(i + pos, li1[i])
else:
print("Not prime")
is_primeList(li1)
for element in li2:
print(element)