Which of the following is a modulus operator in Python?
- %
- &
- *
- ~
The '%' symbol in Python is the modulus operator. It returns the remainder when the first operand is divided by the second operand. For example, 10 % 3 returns 1 because 10 divided by 3 leaves a remainder of 1.
Loading...
Related Quiz
- How would you ensure that a piece of code in a module is only executed when the module is run as a standalone program and not when it is imported?
- The json module provides two methods for JSON serialization: dump() and _______.
- How can you pass dynamic data from a Python back-end to a JavaScript variable in the front-end?
- The true mechanism behind private attributes in Python is a feature called _______.
- A ____ is a type of binary tree where the tree automatically balances itself as items are inserted or removed.