Python Day 14 – Divisors, Prime Numbers and while...else
python
dev.to
Day 14 was about divisors and prime numbers. Again, every problem came wrapped in a little story. Divide the tiles equally A teacher has 12 tiles and wants to split them into equal groups with nothing left over. 12 tiles can be made into: 1 group of 12 2 groups of 6 3 groups of 4 4 groups of 3 6 groups of 2 12 groups of 1 So the answer is just the divisors of 12: 1, 2, 3, 4, 6, 12. Micro first no = 12 divisor = 1 if no % divisor == 0: print(divisor) divisor = d