easycodelearning.com
🐍 Learn Python Online
Back to All Tutorials

Getting Started with Python

What is Python?

Python is a high-level, interpreted programming language known for its simplicity and readability. It was created by Guido van Rossum and first released in 1991. Python's design philosophy emphasizes code readability, making it an excellent choice for beginners.

Why Python?

  • Easy to Learn: Python has a simple syntax that resembles natural English
  • Versatile: Used in web development, data science, AI, and automation
  • Large Community: Extensive documentation and community support
  • Powerful Libraries: Rich ecosystem of libraries for various tasks

Your First Python Program

Let's start with the classic "Hello, World!" program:

print("Hello, World!")

This simple line of code will output: Hello, World!

Understanding the print() Function

The print() function is used to display output on the screen. You can print:

  • Text strings: print("Hello")
  • Numbers: print(42)
  • Multiple items: print("Hello", "World")

Examples:

# Print a simple message
print("Welcome to Python!")

# Print a number
print(100)

# Print multiple items
print("I am", 25, "years old")

Comments in Python

Comments are lines of code that Python ignores. They help explain what your code does. Comments start with a # symbol:

# This is a comment
print("This will be executed")  # This is also a comment

# You can use comments to explain your code
# This makes it easier for others to understand

Key Takeaways

  • Python is a beginner-friendly programming language
  • Use print() to display output
  • Comments start with # and are ignored by Python
  • Python code is read from top to bottom

Practice Time

Try writing your own Python program that prints your name and age. Use the interactive code editor to test your code!

Open Code Editor
Next: Variables & Data Types