Hello World: Create your First Python Program
โก Smart Summary
Hello World is the traditional first Python program. The steps below show how to create and run it in the PyCharm IDE and from the command line, then explain the print() function and the common errors beginners encounter.

In the last tutorial, we completed our Python installation and setup. It is time to create your first program.
Creating First Program
Step 1) Open the PyCharm Editor. You can see the introductory screen for PyCharm. To create a new project, click on “Create New Project”.
Step 2) You will need to select a location.
- You can select the location where you want the project to be created. If you do not want to change the location, then keep it as it is, but at least change the name from “untitled” to something more meaningful, like “FirstProject”.
- PyCharm should have found the Python interpreter you installed earlier.
- Next, click the “Create” Button.
Step 3) Now go up to the “File” menu and select “New”. Next, select “Python File”.
Step 4) A new pop-up will appear. Now type the name of the file you want (here we give “HelloWorld”) and hit “OK”.
Step 5) Now type a simple program – print(‘Hello World!’).
Step 6) Now go up to the “Run” menu and select “Run” to run your program.
Step 7) You can see the output of your program at the bottom of the screen.
Step 8) Do not worry if you do not have the PyCharm Editor installed, you can still run the code from the command prompt. Enter the correct path of a file in the command prompt to run the program.
The output of the code would be:
Step 9) If you are still not able to run the program, we have a Python Editor for you. Please run the given code at the Python Online Editor.
print("Hello World")
Understanding the Hello World Program
The Hello World program is only one line, but it introduces the most important building block in Python: the print() function. The print() function displays whatever you place inside its parentheses on the screen.
In the example below, the text “Hello World” is a string. A string is a sequence of characters wrapped in single or double quotes. Python treats ‘Hello World’ and “Hello World” the same way, so you can use either style.
message = "Hello World"
print(message)
A few points make Python beginner-friendly. You do not need to declare a data type for the variable, there is no semicolon at the end of the line, and the program runs immediately without a separate compile step. Python is also case-sensitive, so print must be written in lowercase.
Common Errors When Writing Your First Python Program
Beginners often hit a few small errors when running their first program. Here are the most common ones and how to fix them:
- NameError / capitalization: Writing Print instead of print. Python is case-sensitive, so the function name must be lowercase.
- SyntaxError: Forgetting a parenthesis or a closing quote, such as print(“Hello World). Always match your brackets and quotes.
- Smart quotes: Copying code with curly quotes (“”) instead of straight quotes (“”). Retype the quotes inside a code editor.
- IndentationError: Adding an unexpected space or tab before print. The first line of code should start at the very left.
- File not found: Running the wrong path in the command prompt. Save the file first and use its exact location.









