Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in Python by (50.2k points)
I want to know about the % symbol in a calculation? If I perform 4 % 2, then the output is apparently equal to 0!!! How?

1 Answer

0 votes
by (108k points)

The % symbol represents the modulus operator in Python. An operation like x % y estimates the remainder of x ÷ y.

a = 10  

b = 20

b % a 

The output will be 0.

Related questions

0 votes
1 answer
0 votes
1 answer
0 votes
1 answer
asked Mar 17, 2021 in Python by laddulakshana (16.4k points)
0 votes
1 answer

Browse Categories

...