Write a Python program to create an array of 10 integers and display the array items. The array should be populated with random integers from 10 to 50 . The program should also display separately all the even number within the array.
import random
integers =[]
for i in range(0,10):
integers.append(random.randint(10, 50))
for i in range(0,10):
print(integers[i])
print("\nAll the even numbers:")
for i in range(0,10):
if integers[i]%2==0:
print(integers[i])
Comments
Leave a comment