Beginner Level

Python Programming

Master Python programming from basics to advanced concepts. Perfect for beginners and career changers looking to enter the world of programming.

10 weeks
15 chapters
750+ students
4.8/5 rating

Chapter 1 of 15 - Getting Started with Python

Chapter 1: Introduction to Python Programming

Why Python?

Python is one of the most popular and versatile programming languages in the world. It's used by companies like Google, Netflix, Instagram, and NASA for everything from web development to artificial intelligence. Here's why Python is perfect for beginners:

🐍 Fun Fact: Python was named after the British comedy group "Monty Python's Flying Circus," not the snake!

What You'll Learn

By the end of this course, you'll be able to build real Python applications including:

Your First Python Program

Let's start with the traditional "Hello, World!" program. In Python, it's incredibly simple:

# This is your first Python program! print("Hello, World!")

That's it! Just one line of code. When you run this program, it will display "Hello, World!" on your screen.

Understanding the Code

Let's break down what happened:

🎯 Try It: Change "Hello, World!" to your name and run the program again. What happens?

Variables and Data Types

Variables are like containers that store data. In Python, you can create variables easily:

# Creating variables name = "Alice" age = 25 height = 5.6 is_student = True # Using variables print("My name is", name) print("I am", age, "years old") print("My height is", height, "feet") print("Am I a student?", is_student)

Python Data Types

Python has several built-in data types:

Data Type Description Example
str Text/String "Hello"
int Whole numbers 42
float Decimal numbers 3.14
bool True/False values True
list Ordered collection [1, 2, 3]

Basic Operations

Python can perform mathematical operations just like a calculator:

# Mathematical operations addition = 10 + 5 # Result: 15 subtraction = 10 - 5 # Result: 5 multiplication = 10 * 5 # Result: 50 division = 10 / 5 # Result: 2.0 power = 10 ** 2 # Result: 100 print("10 + 5 =", addition) print("10 - 5 =", subtraction) print("10 * 5 =", multiplication) print("10 / 5 =", division) print("10 ** 2 =", power)

Getting User Input

You can make your programs interactive by getting input from users:

# Getting user input name = input("What's your name? ") age = input("How old are you? ") print("Hello", name + "!") print("You are", age, "years old.")
🎯 Exercise: Create a program that asks for your name and favorite color, then prints a personalized message like "Hello Alice, I love the color blue too!"

What's Next?

In the next chapter, we'll learn about conditional statements (if/else) that allow your programs to make decisions. We'll also explore loops that let you repeat actions automatically!

📚 Practice Assignment:
1. Create a simple calculator that asks for two numbers and an operation (+, -, *, /)
2. Make a program that converts temperatures from Celsius to Fahrenheit
3. Build a "Mad Libs" game that asks for different words and creates a funny story