Misbak Dereselegn
PRO
2 days ago
Misbakcountry asked

At the end of the code, can we use a semicolon?

Anuj Shrestha
Expert
yesterday
Anuj Shrestha answered

In Python, semicolons are optional and are generally not used. You can add one at the end of a line, but it isn’t required.

Feel free to try the code below in the editor on the right (or switch to the Code tab if you’re on mobile):

print("Hello, World!");

You'll see this code works just fine.

And I see you’ve started your Python journey. Nice... If you have more questions along the way, just let me know.

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