简体   繁体   中英

How can I check if a number is divisible by one of the elements in a list (Python)?

So I am trying to do this problem where I have a number and I'm trying to create a list of multiples from both numbers of the list.

For Example:

list1 = [9,10,12,16]

So I have these two lists. Say I have a number 56. How do I check if 56 is divisible with all three numbers from list1 ?

So I am trying to do this problem where I have a number and I'm trying to create a list of multiples from both numbers of the list.

For Example:

list1 = [9,10,12,16]

So I have these two lists. Say I have a number 56. How do I check if 56 is divisible with all three numbers from list1 ?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM