## Python program to get prime and composite numbers.

startNumber = 1 endNumber = 20 prime = [] composite = []foriinrange(startNumber,endNumber):forpinrange(2, i):if(i % p)==0: composite.append(i)break else: prime.append(i) print("prime: ",prime) print("composite: ",composite) #Output prime: [1, 2, 3, 5, 7, 11, 13, 17, 19] composite: [4, 6, 8, 9, 10, 12, 14, 15, 16, 18]