Notifications
Clear all

Python Program to print all numbers which are divisible by M and N in the List.

   RSS

0
Topic starter

Output Example:
'divisibility by 2 and 5'
[10, 25, 20, 35, 55]

10
20

1 Answer
0
Topic starter

lst=[20,35,75,28,90,78,65,30,100]

m=int(input('enter the 1st number: '))

n=int(input('enter the 2nd number: '))

for i in lst:

    if(i%m==0 and i%n==0):

        print(i)

Share: