Skip to main content

Posts

Showing posts from July, 2026

Program 1

Program for copying prime numbers from a list to a new list  def primechk(n):     t = 0 # Used for storing factors     for i in range(1,n+1):         if n % i == 0:             t+=1     return True if t==2 else False x1= [90,50,79,88,39,61,89,111,139] x2=[] for i in x1:     y = primechk(i)     if y == True:         x2.append(i)     else:         pass print(x1) print(x2)