• **: exponentiation
  • ^: exclusive-or (bitwise)
  • %: modulus
  • //: divide with integral result (discard remainder)
Answer from John Zwinck on Stack Overflow
🌐
W3Schools
w3schools.com › python › python_operators.asp
Python Operators
Python Functions Python Arguments Python *args / **kwargs Python Scope Python Decorators Python Lambda Python Recursion Python Generators Code Challenge Python Range ... Matplotlib Intro Matplotlib Get Started Matplotlib Pyplot Matplotlib Plotting Matplotlib Markers Matplotlib Line Matplotlib Labels Matplotlib Grid Matplotlib Subplot Matplotlib Scatter Matplotlib Bars Matplotlib Histograms Matplotlib Pie Charts · Getting Started Mean Median Mode Standard Deviation Percentile Data Distribution Normal Data Distribution Scatter Plot Linear Regression Polynomial Regression Multiple Regression Scale Train/Test Decision Tree Confusion Matrix Hierarchical Clustering Logistic Regression Grid Search Categorical Data K-means Bootstrap Aggregation Cross Validation AUC - ROC Curve K-nearest neighbors
Top answer
1 of 3
197
  • **: exponentiation
  • ^: exclusive-or (bitwise)
  • %: modulus
  • //: divide with integral result (discard remainder)
2 of 3
45

You can find all of those operators in the Python language reference, though you'll have to scroll around a bit to find them all. As other answers have said:

  • The ** operator does exponentiation. a ** b is a raised to the b power. The same ** symbol is also used in function argument and calling notations, with a different meaning (passing and receiving arbitrary keyword arguments).
  • The ^ operator does a binary xor. a ^ b will return a value with only the bits set in a or in b but not both. This one is simple!
  • The % operator is mostly to find the modulus of two integers. a % b returns the remainder after dividing a by b. Unlike the modulus operators in some other programming languages (such as C), in Python a modulus it will have the same sign as b, rather than the same sign as a. The same operator is also used for the "old" style of string formatting, so a % b can return a string if a is a format string and b is a value (or tuple of values) which can be inserted into a.
  • The // operator does Python's version of integer division. Python's integer division is not exactly the same as the integer division offered by some other languages (like C), since it rounds towards negative infinity, rather than towards zero. Together with the modulus operator, you can say that a == (a // b)*b + (a % b). In Python 2, floor division is the default behavior when you divide two integers (using the normal division operator /). Since this can be unexpected (especially when you're not picky about what types of numbers you get as arguments to a function), Python 3 has changed to make "true" (floating point) division the norm for division that would be rounded off otherwise, and it will do "floor" division only when explicitly requested. (You can also get the new behavior in Python 2 by putting from __future__ import division at the top of your files. I strongly recommend it!)
Discussions

what does //= mean in python?
number //= 10 is same as number = number // 10 And // operator is integer division ... which is pretty much division that discards the decimal part. 3 / 2 = 1.5 3 // 2 = 1 Using // operator with number 10 is usually used to remove right most digit. 195 / 10 = 19.5 195 // 10 = 19 More on reddit.com
🌐 r/learnpython
14
20
August 18, 2023
What does ${} mean in python code
Hello everyone, I am new here and also new to learning python. I came across this code in databricks notebook and trying to understand what that means. I searched up for ${} in python but it doesn’t seem relevant to the code i’m looking into. Appreciate if someone can please help. More on discuss.python.org
🌐 discuss.python.org
0
September 29, 2024
What does ! Mean?
i saw the use of ! Show us what you saw! More on reddit.com
🌐 r/learnpython
22
0
May 25, 2023
What exactly is "in" in Python?
Yep, 'in' is a operator used to check if a value is exists in a sequence or not. More on reddit.com
🌐 r/learnpython
44
28
January 9, 2021
🌐
Python.org
discuss.python.org › python help
What is ... meaning in python - Python Help - Discussions on Python.org
August 28, 2023 - Can someone explain to me what the … means here? like this: days: float = ..., or : def dst(self) -> timedelta | None: ...
🌐
DataFlair
data-flair.training › blogs › python-operator
Python Operator - Types of Operators in Python - DataFlair
July 12, 2025 - Python Operators: Learn Python arithmetic, relational, logical, assignment, bitwise, membership and identity operator with syntax & examples
🌐
Python
docs.python.org › 3 › genindex-Symbols.html
Index — Python 3.14.3 documentation
© Copyright 2001 Python Software Foundation. This page is licensed under the Python Software Foundation License Version 2. Examples, recipes, and other code in the documentation are additionally licensed under the Zero Clause BSD License. See History and License for more information.
Find elsewhere
🌐
GeeksforGeeks
geeksforgeeks.org › python › python-operators
Python Operators - GeeksforGeeks
Python Arithmetic operators are used to perform basic mathematical operations like addition, subtraction, multiplication and division. In Python 3.x the result of division is a floating-point while in Python 2.x division of 2 integers was an integer.
Published   December 2, 2025
🌐
Python.org
discuss.python.org › python help
What does ${} mean in python code - Python Help - Discussions on Python.org
September 29, 2024 - Hello everyone, I am new here and also new to learning python. I came across this code in databricks notebook and trying to understand what that means. I searched up for ${} in python but it doesn’t seem relevant to the …
🌐
Quora
quora.com › What-is-the-meaning-of-in-Python-?
What is the meaning of @ in Python ?
Answer (1 of 6): @ is used in python for decorators. Let say you want to calculate the time a function takes to execute. One thing you could do is inside the function body have statements [code]t=time.clock func body time.clock-t[/code] This is ok if you want to time only one function. But...
🌐
Codecademy
codecademy.com › learn › introduction-to-python-dvp › modules › python-syntax-dvp › cheatsheet
Introduction to Python: Python Syntax Cheatsheet | Codecademy
The number 0 represents an integer value but the same number written as 0.0 would represent a floating point number. ... Python supports the joining (concatenation) of strings together using the + operator. The + operator is also used for mathematical addition operations.
🌐
Built In
builtin.com › software-engineering-perspectives › python-symbol
What Is the @ Symbol in Python? | Built In
March 18, 2025 - The @ symbol in Python is used to apply a decorator to a function or method to extend its functionality, or to help perform matrix multiplication.
🌐
YouTube
youtube.com › dave gray
Python Operators for Beginners | Python tutorial - YouTube
Web Dev Roadmap for Beginners (Free!): https://bit.ly/DaveGrayWebDevRoadmapLearn Python operators for beginners in this tutorial. We'll look at assignment, a...
Published   February 28, 2023
🌐
freeCodeCamp
freecodecamp.org › news › what-does-double-slash-mean-in-python
What Does // Mean in Python? Operators in Python
July 21, 2022 - To prepare your mind for the result, rounding down a negative number means going away from 0. So, -12 divided by 5 results in -3. Don’t get confused – even though at first glance it seems like the nubmer is getting "bigger", it's actually getting smaller (further from zero/a larger negative number). num1 = -12 num2 = 5 num3 = num1 // num2 print("floor division of", num1, "by", num2, "=", num3) # floor division of -12 by 5 = -3 · In Python, math.floor() rounds down a number to the nearest integer, just like the double slash // operator does.
🌐
Quora
quora.com › In-Python-what-does-mean-after-a-variable-name
In Python, what does [:] mean after a variable name? - Quora
Answer (1 of 6): In python , [:] is used for indexing. for example- consider the string welcome- 0 1 2 3 4 5 6 W E L C O M E -7 -6 -5 -4 -3 -2 -1 You can declare string as - str1 = “Welcome” [starting index:ending index:step] str1[0:3] will ...
🌐
Real Python
realpython.com › python-operators-expressions
Operators and Expressions in Python – Real Python
January 11, 2025 - This means that the result is the greatest integer that’s smaller than or equal to the quotient. For positive numbers, it’s as though the fractional portion is truncated, leaving only the integer portion. ... The Python comparison operators allow you to compare numerical values and any ...
🌐
Real Python
realpython.com › what-does-arrow-mean-in-python
What Does -> Mean in Python Function Definitions? – Real Python
September 15, 2025 - In Python, every value stored in a variable has a type. Because Python is dynamically typed, variables themselves don’t have fixed types—they can hold values of any type at different times. This means the same variable might store an integer at one moment and a string the next.
🌐
Mimo
mimo.org › glossary › python › in-operator
Master Python's in Operator for Various Coding Scenarios
Start your coding journey with Python. Learn basics, data types, control flow, and more ... The in operator in Python is a membership operator used to check if a value is present in a sequence (like a list or string). It returns a boolean value: True if the value is found, and False otherwise.
🌐
Teradata
teradata.com › home
What is Python? | Teradata
October 12, 2023 - Python is an interpreted, ... in 1991. Designed to be easy as well as fun, the name "Python" is a nod to the British comedy group Monty Python....