Python Beginner's Course
1. Introduction to Python
- What is Python?
Python is a high-level programming language known for its simplicity and readability.
It can be used for web development, data analysis, automation, AI, and more.
2. Setting Up Python
- How to install Python and run your first program: print("Hello, World!")
3. Basic Syntax
- Introduction to printing with the print() function.
- Understanding how to write and run code in Python.
4. Variables and Data Types
- Variables store data that can be used later in the program.
- Common Data Types:
- String: Text enclosed in quotes ("Hello").
- Integer: Whole numbers (5, 10, -3).
- Float: Decimal numbers (3.14, 2.0).
- Boolean: True or False.
Example of variable assignment:
name = "Fahad"
age = 15
height = 5.8
is_student = True
5. Basic Operations
- Arithmetic Operations:
- Addition: +
- Subtraction: -
- Multiplication: *
- Division: /
Example:
x = 10
y=5
print(x + y) # Addition
print(x - y) # Subtraction
print(x * y) # Multiplication
print(x / y) # Division
- String Operations:
- Concatenation: Combining strings with +
Example:
greeting = "Hello, " + "Fahad!"
print(greeting) # Output: Hello, Fahad!
6. Practice Exercises
- Create variables for your name, age, and favorite food.
- Perform basic arithmetic and print the result.
- Combine strings to make a sentence with your variables.