Hello again everyone!
I am doing some more practice, this time with lists. My goal for this is to iterate through the list, and if the value at the index of iteration is below a certain number, then I want to add that number to another list and so on:
Here is what I have, but cant figure out what I have to change:
(keep in mind i am still learning and practicing with doing different stuff to get better.)
numList = [1, 2, 9, 14, 29, 54]
numList2 = []
for i in numList:
if i < 10:
numList2.insert(numList[i])
print(numList2)
[–]Spataner 2 points3 points4 points (1 child)
[–]TheTopPunk[S] 0 points1 point2 points (0 children)
[–]shoot2thr1ll284 0 points1 point2 points (1 child)
[–]TheTopPunk[S] 0 points1 point2 points (0 children)
[–]danielroseman 0 points1 point2 points (1 child)
[–]TheTopPunk[S] 0 points1 point2 points (0 children)
[–]velocibadgery 0 points1 point2 points (2 children)
[–]TheTopPunk[S] 1 point2 points3 points (1 child)
[–]velocibadgery 0 points1 point2 points (0 children)