Jogblackhole
5 months ago
Jogblackholecountry asked

What is the purpose of brackets like () in Python?

Sarthak Baral
Expert
3 months ago
Sarthak Baral answered

Hi Jogblackhole,

In Python, () is mainly used to call a function and pass values into it.

Example:

print("Hello")

Here, print() is the function, and the text inside () is what it should print.

() is also used to group math so Python does that part first:

(2 + 3) * 4

If you have more questions, I am here to help 😊

Python
This question was asked as part of the Learn Python Basics course.