Python is one of the most popular programming languages in the world. It was created by Guido van Rossum in 1991 and designed to be easy to read and write.
Go to the official Python website and download the latest version for your operating system:
๐ https://www.python.org/downloads/
After installation, open a terminal (Command Prompt on Windows, Terminal on Mac/Linux) and type:
python --version
You should see something like: Python 3.12.x
While you can write Python in any text editor, we strongly recommend VS Code (Visual Studio Code) โ it's free, powerful, and widely used by professional developers.
Download VS Code here:
๐ https://code.visualstudio.com/download
Choose the version for your operating system (Windows, macOS, or Linux) and install it.
After installing VS Code, add the Python extension:
Now you're ready to write Python code! Create a new file with a .py extension and start coding.
Python is the perfect first language for your programming journey. Let's get started! ๐
What is Python? Describe it in one sentence.
Name TWO real-world applications of Python.
Now that you have Python installed (see the previous lesson if you haven't done so yet), let's write your very first program!
Let's write the classic "Hello, World!" program.
Create a new file called hello.py and add this line of code:
print("Hello, World!")
Now run it in your terminal:
python hello.py
๐ Congratulations! You should see:
Hello, World!
print() is a built-in function that displays text on the screen" " is called a stringTry another example. Create a file called about_me.py:
print("My name is Alice")
print("I am learning Python!")
print("Python is " + "awesome!")
Run it and see the output. You've just written your first multi-line program!
.py files before running themprint() works, but Print() does notWrite a Python program that prints: My name is [Your Name]
What does the print() function do in Python?