Advertisement
dino3vr

Untitled

Jan 14th, 2020
110
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.31 KB | None | 0 0
  1. nums = [x for x in range(1, 50)]
  2. divs = [3, 5]
  3. correct = []
  4. isCorrect = bool()
  5.  
  6. for num in nums:
  7.     for div in divs:
  8.         if num % div == 0:
  9.             correct.append(num)
  10.             isCorrect = True
  11.         print(f"{num}/{div} = {isCorrect}", end=" "); print(*correct, sep=", ")
  12.         isCorrect = False
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement