Introduction
Hey there! 👋
Python has become one of the most popular programming languages. If you want to learn Python from scratch, this blog is for you.
By the end of this blog, you will be able to create and run your first “Hello, World!” program.
So, let’s get started!💪
What is Python?
Python is an easy-to-understand, simple, and close-to-English programming language that follows the OOP (Object-Oriented Programming) concept. Instead of using English to communicate with each other, we use Python to interact with machines.
Why Python?
Python is awesome for the following reasons:
- Easy to Write/Read/Understand: Like English words, Python is super easy to write, read, and understand. For example,
apple == apple
will returnTrue
, whileapple == banana
will returnFalse
. This simplicity is a hallmark of Python. - Versatile: Python can be used in various fields such as web development, artificial intelligence, machine learning, mobile development, game development, data science, data analysis, robotics, automation, and many more.
- Strong Community: Python has a strong community. Many programmers use Python, constantly updating packages and adding new features.
- Portable: Python is a portable programming language, meaning you can run the same program on any operating system, such as Windows, Ubuntu, or macOS.
- Object-Oriented Programming (OOP): Python follows the object-oriented programming paradigm, which involves concepts like objects and classes. An object represents a real-world entity, while a class is the blueprint of an object.
We will cover these features in detail in future posts.
Who Created Python?
Python was created by Guido van Rossum in the late 1980s. He wanted to create an easy-to-use and fun programming language and named it after the famous comedy show “Monty Python’s Flying Circus,” which he liked.
Setting Up Python on Your Local Machine
Installing Python on Windows Machine
1. Go to the Python official website(https://www.python.org/downloads/).
2. Click on the “Download” button for the latest version.
3. Run the downloaded file and make sure to check the box that says “Add Python to PATH” before clicking “Install Now.”
4. Follow the prompts, clicking “Next” as needed.
Confirm that you have installed Python correctly by typing python --version
or python3 --version
in your terminal or command prompt.
Installing Python on Ubuntu
- Open your terminal.
- Type
sudo apt update
and press Enter. - Then type
sudo apt install python3
and press Enter.
Confirm that you have installed Python correctly by typing python --version
or python3 --version
in your terminal or command prompt.
Create Your First Python Program
Now, let’s create your first Python program. ✋
- Open Notepad or any text editor you like.
- Write the following code in your file:
print("Hello, World!")
- Save the file as “
main.py
“. - Open the command prompt and run the program by typing
python main.py
(for Windows) orpython3 main.py
(for Ubuntu).
Conclusion
You’ve taken your first step into the world of programming with Python. It’s a journey filled with endless possibilities. Remember, the key to learning programming is practice. Keep experimenting, building, and most importantly, have fun!
Happy Coding!
Support my passion for sharing development knowledge by donating to Buy Me a Coffee. Your contribution helps me create valuable content and resources. Thank you for your support!
Thank you for taking the time to read this blog about writing your first Python program. I hope you found the information useful and informative.
If you have any questions or comments about the information presented in this blog, please feel free to reach out. Thank you again for reading!