• **: exponentiation
  • ^: exclusive-or (bitwise)
  • %: modulus
  • //: divide with integral result (discard remainder)
Answer from John Zwinck on Stack Overflow
Top answer
1 of 3
199
  • **: 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 is ... meaning in python
Can someone explain to me what the … means here? like this: days: float = ..., or : def dst(self) -> timedelta | None: ... More on discuss.python.org
🌐 discuss.python.org
0
0
August 28, 2023
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
What do () and [] and . Mean in python?
In short, () means you’re calling a function that does something, [] means you’re grabbing something out of a sequence, and . means you’re accessing an attribute (which could be data, a function, etc.) attached to an object. More on reddit.com
🌐 r/learnpython
11
1
January 29, 2021
🌐
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.
🌐
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
🌐
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: ...
🌐
freeCodeCamp
freecodecamp.org › news › what-does-double-slash-mean-in-python
What Does // Mean in Python? Operators in Python
July 21, 2022 - In Python, you use the double slash // operator to perform floor division. This // operator divides the first number by the second number and rounds the result down to the nearest integer (or whole number).
🌐
GeeksforGeeks
geeksforgeeks.org › python › python-operators
Python Operators - GeeksforGeeks
Python Logical operators perform Logical AND, Logical OR and Logical NOT operations. It is used to combine conditional statements. The precedence of Logical Operators in Python is as follows:
Published   December 2, 2025
Find elsewhere
🌐
Codecademy
codecademy.com › learn › introduction-to-python-dvp › modules › python-syntax-dvp › cheatsheet
Introduction to Python: Python Syntax Cheatsheet | Codecademy
If a string has to be broken into multiple lines, the backslash character \ can be used to indicate that the string continues on the next line. ... A SyntaxError is reported by the Python interpreter when some portion of the code is incorrect.
🌐
DataFlair
data-flair.training › blogs › python-operator
Python Operator - Types of Operators in Python - DataFlair
July 12, 2025 - We have three Python logical operator – and, or, and not that come under python operators. ... If the conditions on both sides of the operator are true, then the expression as a whole is true. ... The expression is false only if both the statements around the operator are false. Otherwise, it is true. ... ‘and’ returns the first False value or the last value; ‘or’ returns the first True value or the last value ... This inverts the Boolean value of an expression.
🌐
Built In
builtin.com › software-engineering-perspectives › python
What Is Python? (Definition, Uses, Benefits) | Built In
While other languages may be capable of handling tasks in all of these environments, Python stands out due to its ability to excel in each. Python is also an interpreted language, meaning that it executes instructions directly without the need for compilation, resulting in faster development ...
🌐
Reddit
reddit.com › r/learnpython › what do () and [] and . mean in python?
r/learnpython on Reddit: What do () and [] and . Mean in python?
January 29, 2021 -

For example Print("hello world") Why do i put in the "()" Why doesnt a simple print hello world work? Whats the logic behind using the () What does it tell the compiler about the code?

Similarly. List[2] and append.list

How does the compiler see those instructions as?

Sorry if this question sounds noobish. I AM a noob

Top answer
1 of 4
12
In short, () means you’re calling a function that does something, [] means you’re grabbing something out of a sequence, and . means you’re accessing an attribute (which could be data, a function, etc.) attached to an object.
2 of 4
6
The short answer (this is a really good question, BTW) is that these are operators. That is, they're special symbols - like + or ~ - that tell the interpreter to perform some operation. To do something. The way that a statement like 2 + 2 is turned into the value 4 is called evaluation, and Python is trying to evaluate the lines of code you write, unless they're special statements (usually related to the flow of control through your program.) The () calling operator is an operator that means "the preceding value is a callable function; call it and evaluate to its return value." So in the same way that 2 + 2 reduces or simplifies to 4, print("hw") reduces or evaluates to that function's return value (which, for print, is None.) As a side effect, print also writes its argument to the console. That's actually the useful part, of course. Operators can come at different parts of the expression and we classify them with names related to that. + is an infix operator, because it appears in between its operands (the numbers it's going to add.) . is also an infix operator, because it appears between the name being looked up (on the right) and the namespace that name is being looked up in (on the left.) () comes at the end of the expression, so it's a postfix operator, and an operator like ~ or not comes before its operand, so we call it a prefix operator.
🌐
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 …
🌐
Codecademy
codecademy.com › article › glossary-python
Python Glossary | Codecademy
A Pythonic way of extracting “slices” of a list using a special bracket notation that specifies the start and end of the section of the list you wish to extract. Leaving the beginning value blank indicates you wish to start at the beginning of the list, leaving the ending value blank indicates you wish to go to the end of the list. Using a negative value references the end of the list (so that in a list of 4 elements, -1 means ...
🌐
GeeksforGeeks
geeksforgeeks.org › python › parentheses-square-brackets-and-curly-braces-in-python
Parentheses, Square Brackets and Curly Braces in Python - GeeksforGeeks
July 26, 2025 - In conclusion, understanding the differences between parentheses (), curly braces {}, and square brackets [] in Python is essential for writing clear, efficient, and well-structured code. Parentheses are versatile, used for function calls, defining tuples, and grouping expressions.