- Trending Categories
- Data Structure
- Operating System
- C Programming
- Social Studies
- Fashion Studies
- Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
What does these operators mean (** , ^ , %, //) ?
In Python ** is a raised to operator. It returns x raised to y in the expression x**y
>>> x=5 >>> y=3 >>> x**y 125
^ is a bitwise XOR operator. Taking two bits as operands it returns 1 if one is 1 and other is 0
>>> a=10 >>> bin(a) #0001 1010 '0b1010' >>> b=20 >>> bin(b) #0010 0100 '0b10100' >>> c=a^b >>> c 30 >>> bin(c) #0011 1110 '0b11110'
// is defined as floor division operator. It returns integer part of result of division operation
>>> 10/3 3.3333333333333335 >>> 10//3 3
For negative division, floor rounds towards negative infinity.
>>> -10/3 -3.3333333333333335 >>> -10//3 -4
% symbol is defined as modulo operator and returns remainder of division operation.
>>> 10%3 1 >>> 10%2 0
In case of negative division difference bewen upper multiple and numerator is calculated
>>> -10%3 2 >>> -5%2 1 >>> 73%9 1 >>> -73%9 8
- What does humus mean?
- What does psychology mean?
- What does geometry mean?
- What Does Defensive Security Mean?
- What Does Offensive Security Mean?
- What does Waning Gibbous mean?
- What does createdCollectionAutomatically mean in MongoDB?
- What does # mean in Lua programming?
- What does operator ~= mean in Lua?
- What does series mean in pandas?
- What does "return@" mean in Kotlin?
- "Makkal Needhi Maiam" what does it mean?
- What does INT(7) in MySQL mean?