Explain the //, %, and ** operators in python?
Answer / Shyam Veer Arya
1. Floor Division (//): This operator performs integer division. It always gives an integer as a result by rounding down the quotient towards minus infinity. For example: 7 // 3 returns 2.
2. Modulus (%): As mentioned earlier, this operator is used to get the remainder after division. For example: 7 % 3 returns 1.
3. Exponentiation (**): This operator raises a number to a power. For example: 2 ** 4 returns 16.
| Is This Answer Correct ? | 0 Yes | 0 No |
Is there a reverse function in python?
What is the use of assertions in python?
What are classes in programming?
What is the use of dir() function?
What will be the output of data[-2] from the list data = [1,5,8,6,9,3,4]?
What is flask used for in python?
Python or r: which one would you prefer for text analytics?
How do you access private methods in python?
How are inheritance and overriding methods are related?
What is the purpose of not in operator?
What are local variables and global variables in python?
What is unlink in python?