Answer to Question #226183 in Python for sonto

Question #226183

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.


1
Expert's answer
2021-08-15T01:16:01-0400
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])





Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS