Q. Write a program that creates a list of all integers less then 100 that are multiples of 3 or 5.


You can understand by Watching video :-



Answer :-

lst = [ ]

for i in range (1,100):
    if i % 3 == 0 or i % 5 == 0 :
        lst += [ i ]

print (lst)

Output :-

[3, 5, 6, 9, 10, 12, 15, 18, 20, 21, 24, 25, 27, 30, 33, 35, 36, 39, 40, 42, 45, 48, 50, 51, 54, 55, 57, 60, 63, 65, 66, 69, 70, 72, 75, 78, 80, 81, 84, 85, 87, 90, 93, 95, 96, 99]
>>>


Post a Comment

You can help us by Clicking on ads. ^_^
Please do not send spam comment : )

Previous Post Next Post