Python challenge! Can you tell the answer? #coding #dev #programming #python

preview_player
Показать описание

Рекомендации по теме
Комментарии
Автор

Hello - You are using modulus, which is finding the remainder when you divide by 2.

The True / Flase Boolean indicates that False = 0 and True = 1, therefore if you change this to True%1, you will instead get 0, as that is the remainder of 1 / 1.

If anyone wants to test why this works this way, you can attempt a few integers such as 1%5, 5%10, as long as the second number is higher than the first, the remainder will always be the first number.

randomperson