Sovi.AI - AI Math Tutor

Scan to solve math questions

QUESTION IMAGE

write a python for loop that iterates through a list of numbers and pri…

Question

write a python for loop that iterates through a list of numbers and prints out only the numbers that are divisible by 5.

Explanation:

Step1: Define the list

number_list = [10, 12, 15, 18, 20]

Step2: Write the for - loop

for num in number_list:
    if num % 5 == 0:
        print(num)

Answer:

number_list = [10, 12, 15, 18, 20]
for num in number_list:
    if num % 5 == 0:
        print(num)