filmov
tv
% (modulus) operator in Python 🐍 #shorts
Показать описание
Pronounced the maa-juh-luhs operator. % gives you the integer remainder when dividing 2 integers. You can use it to get every 2nd or 3rd number by:
[x for x in range(20) if x % 3 == 0]
[x for x in range(20) if x % 3 == 0]