๐ง๐๐ถ๐ป ๐ฃ๐ฟ๐ถ๐บ๐ฒ๐ ๐ฎ๐ป๐ฑ ๐๐ถ๐๐ถ๐๐ถ๐ฏ๐น๐ฒ ๐ฏ๐ ๐ญ๐ญ
I practiced using functions today. Learn the logic behind these two coding tasks.
Task 1: Twin Primes
- Check if a number is prime.
- Add 2 to the number.
- Check if the result is also prime.
Task 2: Divisible by 11
- Sum the alternating digits.
- Subtract the two sums.
- The result must be 0 or divisible by 11.
I learned modulo and float logic. I used trial and error to fix my syntax. I will keep learning.
Source: https://dev.to/buddingdeveloper/twin-primes-and-divisible-by-11-5hjg