divmod is a wonderful, nice, little built-in function in Python that allows you to do division and modulus operation together. Using it, you can make your code slightly beautiful, thus Pythonic! Check the following example –
>>> 10 / 3
>>> 10 // 3
>>> 10 % 3
>>> divmod(10, 3)
#codango #developer #development #coder #coding
We're happy to share this resource that we found. The content displayed on this page is property of it's original author and/or their organization.