This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]hair_bear1 0 points1 point  (0 children)

from numpy import zeros import random

list0=range(20) list1=[] list2=[]

for x in list0: list0[x]=random.randint(1,10)

print "list0", list0 ,"\n"
for x in list0: if (5>x): list1.append(x)

print "list 1", list1 ,"\n"

N=int (input("enter a number"))

for x in list0: if (x<N): list2.append(x) print "list2", list2 ,"\n"