Intellipaat 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 (107k 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

31k questions

32.8k answers

501 comments

693 users

Browse Categories

...