What Is Python?
Python is a programming language that is easy to learn, has simple syntax, and is widely used for web development, task automation, data analysis, artificial intelligence (AI), and many other applications.
Python is an excellent choice for beginners because its code is easy to read and understand.
Step 1: Download Python
Visit the official Python website:
https://www.python.orgClick Downloads.
Download the latest Python version suitable for your operating system (Windows, Linux, or macOS).
Step 2: Install Python
After the installer has been downloaded:
Run the Python installer.
Check the option:
Add Python to PATH
Click Install Now.
Wait for the installation process to finish.
Click Close.
Step 3: Verify the Installation
On Windows
Press Windows + R
Type:
cmd
Press Enter.
The Command Prompt window will appear.
Type:
python --version
or
python -V
If the installation is successful, you will see something similar to:
Python 3.14.0
The version number may differ depending on the installed version.
Step 4: Start Python
In Command Prompt, type:
python
If successful, you will see:
Python 3.14.0
>>>
The >>> prompt means Python is ready to accept commands.
First Example Program
Type:
print("Hello World")
Then press Enter.
Output:
Hello World
Explanation:
print()displays text on the screen.The text inside quotation marks is displayed exactly as written.
Second Example: Simple Addition
Type:
print(10 + 5)
Press Enter.
Output:
15
Explanation:
Python calculates the mathematical expression inside the parentheses and displays the result.
Third Example: Using Variables
Type:
name = "John"
print(name)
Output:
John
Explanation:
nameis called a variable.Variables are used to store data.
The value of a variable can be displayed using
print().
Exiting Python
To exit Python, type:
exit()
or press:
Ctrl + Z then Enter
(Windows)
Conclusion
If you successfully ran:
print("Hello World")
and
print(10 + 5)
then Python has been installed correctly and you are ready to learn more advanced topics such as:
Variables
Data Types
Operators
Conditional Statements (if)
Loops (for and while)
Functions
Lists and Dictionaries
Object-Oriented Programming (OOP)
Happy Python learning!
Baca versi Indonesia: Klik Di sini

No comments:
Post a Comment