Can I perform the floor division and modulo operators at the same time? | SoloLearn: Learn to code for FREE!

+3

Can I perform the floor division and modulo operators at the same time?

5/20/2020 4:09:32 PM

Newday Motivation

2 Answers

New Answer

+10

If you are talking from python - Yes, you can do it with divmod(): res = divmod(13,5) # result is a tuple (2,3) 2 is quotient, 3 is remainder #or quo, rem = divmod(13,5) # result are 2 variables quo is quotient, rem is remainder

0

If yes then how?