import random
arr = [random.randint(0, 100) for i in range(100)]
out = []
for element in arr:
if element < 5: out.append(element)
print(f"Start array: {arr}\nOut array: {out}")
Copyright © 2024 SCHOLAR.TIPS - All rights reserved.
Answers & Comments
import random
arr = [random.randint(0, 100) for i in range(100)]
out = []
for element in arr:
if element < 5: out.append(element)
print(f"Start array: {arr}\nOut array: {out}")