0d: 00h: 00m: 00s

🎁 Get 3 extra months of learning β€” completely FREE

That's 90 extra days to master new skills, build more projects, and land your dream job.

Become a PRO
Background Image

🎁 Get 3 extra months of learning completely FREE

Become a PRO
Jogblackhole
2 months ago
Jogblackholecountry asked

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

Sarthak Baral
Expert
yesterday
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.