Welcome to the exciting world of Python programming! Whether you’re a complete beginner to coding or just new to Python, this guide will walk you through creating and running your very first Python program. Let’s get started on this journey into one of the most popular and versatile programming languages today.
Setting Up Your Python Environment
Before diving into coding, it’s essential to ensure that Python is installed in your environment. Python comes pre-installed on many systems, but it’s always good to verify:
python3 --versionIf you see a version number, you’re all set! If not, you’ll need to install Python from the official website (python.org) for your operating system.
Creating Your First Python File
Now that you have Python installed, let’s create your first Python file. You can do this directly from your terminal using the nano text editor:
nano first_program.pyThis command opens the nano editor and creates a new file called “first_program.py”. The .py extension is important as it tells the system this is a Python file.
Writing Your First Line of Code
In the newly created file, type your first line of Python code:
print("hello guys")The print command is a fundamental function in Python that displays whatever is inside the parentheses on the screen. In this case, it will display the text “hello guys” when the program runs.
After adding this line, save your changes and exit the editor. In nano, you can do this by pressing Ctrl+X, then Y to confirm, and finally Enter to save and exit.
Running Your First Python Program
The exciting part comes now – running your code! Execute your Python file with the following command:
python3 first_program.pyYou should see this output in your terminal:
hello guysCongratulations! You’ve just written and executed your first Python program!
Beyond the Terminal: Using Code Editors
While using the terminal and nano is a great way to start, as you progress in your Python journey, you might want to use more advanced code editors like VS Code, or Sublime Text. These editors offer features like syntax highlighting, code completion, and debugging tools that make coding more efficient and enjoyable.
Understanding the Print Function
Let’s take a closer look at the print function, which you just used:
print("hello guys")printis the name of the function- The parentheses
()contain the arguments (the data to be printed) - The quotation marks
""indicate that “hello guys” is a string (text data)
The print function is one of the first functions Python beginners learn, and you’ll use it frequently to display information, debug your code, and interact with users.
Python is known for its readability and simplicity, making it an excellent choice for beginners. Every expert programmer started exactly where you are now – with a simple “hello world” program and the curiosity to learn more.
Happy coding!

