fork download
  1. n = 6
  2. i = 2
  3. j = 3
  4.  
  5. nat_nums, x = [], 0
  6.  
  7. while len(nat_nums) < n:
  8. if(x%i == 0 or x%j ==0):
  9. nat_nums.append(x)
  10. x += 1
  11.  
  12. print(nat_nums)
  13.  
Success #stdin #stdout 0.02s 9348KB
stdin
Standard input is empty
stdout
[0, 2, 3, 4, 6, 8]