Write Program Prints Elements List Divisible 5 Python Q37073104

  1. Write a program that prints all of the elements in a list thatare divisible by 5. PYTHON

Solution


CODE:

# create a listnumbers = [1,2,3,4,5,6,7,8,9,10]# loop through all the elements of the listfor i in numbers: # if number is divisible by 5 then print it. if i % 5 == 0: print(i)

# create a list 1 2 3 numbers [1.2,3.4.5.6.7.8.9,101 # loop through all the elements of the list for iin numbers: 5 # if numb

OUTPUT:

C: UsersBHARGABI PycharmProjectsuntitle 10 Process finished with exit code

#

OR
OR

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.