28
Day 1: Python Basics (15-Minute Tutorial)
1. Overview of Python
- Python is a high-level, interpreted programming language known for its readability and simplicity.
- It’s widely used in various domains, including web development, data analysis, artificial intelligence, and more.
2. Setting Up Your Environment
- Install Python: Download and install the latest version of Python from python.org.
- Choose an IDE: You can use any code editor, but popular options include:
- Jupyter Notebook: Ideal for data analysis and visualization.
- VS Code: A versatile code editor with excellent support for Python.
- PyCharm: A powerful IDE specifically for Python development.
3. Basic Syntax and Data Types
- Variables: Used to store data.
- Data Types: Common data types in Python include:
- Strings (
str
) - Integers (
int
) - Floats (
float
) - Booleans (
bool
)
- Strings (
4. Control Flow
- If/Else Statements: Allow you to execute code based on conditions.
- Loops: Used to execute a block of code multiple times.
- For Loop:
- While Loop:
5. Functions
- Functions are blocks of reusable code.
6. Input/Output
- Input: Get user input using
input()
. - Output: Print statements display results on the console.
7. Practice Exercise (5 minutes)
- Write a function that takes a number as input and returns whether it is even or odd.
- Use the input function to get a number from the user and print the result.
Next Steps
For your next session, we’ll dive into more Python concepts, such as data structures and libraries commonly used in data analysis and AI.