Intellipaat Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in Python by (16.4k points)

What is 3 % 4 in Python? For example, I don't have the foggiest idea what the result is if: 

  1. The remainder is a fraction (whereas the operands are non-fractions)
  2. The first operand < the second operand

1 Answer

0 votes
by (26.4k points)

Here, % sign was the Modulus operator. 

Look at the example:

C:\Users\jon>python

Python 2.6.5 (r265:79096, Mar 19 2010, 21:48:26) [MSC v.1500 32 bit (Intel)] on win

Type "help", "copyright", "credits" or "license" for more information.

>>> 3%4

3

>>> 4%3

1

>>> 4.5%3

1.5

>>> 4%3.5

0.5

Want to learn python to get expertise in the concepts of python? Join python certification course and get certified

For more details, do check out the below video tutorial...

Related questions

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

31k questions

32.8k answers

501 comments

693 users

Browse Categories

...