Reputation: 3
I'm trying to make a program that involves checking if a number's modulus is zero for every number in a list, and then, if it's modulus of all of them is zero, it adds it to the list. Like this:
nums = [1,2,3,5]
if( var1% *Everything in nums* ==0):
nums.append(var1)
If you're wondering, It's for calculating primes. Thanks in advance.
Upvotes: 0
Views: 52