Skip to content

Latest commit

 

History

History
104 lines (81 loc) · 5.14 KB

File metadata and controls

104 lines (81 loc) · 5.14 KB

Python Basics

Welcome to the Python Basics repository. This is a comprehensive, absolute beginner-friendly guide designed to help you understand what Python is and introduce you to its core concepts.

What is Python?

Python is a popular, high-level, interpreted, and general-purpose programming language. It was designed to emphasize code readability, allowing programmers to express concepts in fewer lines of code than languages like C++ or Java.

History

Python was created by Guido van Rossum and was first released in 1991. The language is named after the BBC comedy show "Monty Python's Flying Circus" rather than the snake.

Why Python?

  • Easy to Learn: Python has a simple syntax similar to the English language, making it excellent for beginners.
  • Platform Independent: Python code can run on Windows, macOS, Linux, and Unix systems without modification.
  • Large Standard Library: It offers a rich set of built-in modules and packages, meaning you can solve complex problems with very little extra code.
  • Broad Application: Python is used in many fields, including:
    • Web Development (server-side)
    • Software Development
    • Data Science and Machine Learning
    • Automation and Scripting
    • System Scripting

Repository Structure

python_basics/
├── 00_environment_and_tooling/
├── 01_basic_syntax/
├── 02_comments/
├── 03_tokens/
├── 04_variables_and_data_types/
├── 05_operators/
├── 06_input_output/
├── 07_conditional_statements/
├── 08_loops/
├── 09_functions/
├── 10_type_hints/
├── 11_exception_handling/
├── 12_strings/
├── 13_lists/
├── 14_tuples/
├── 15_sets/
├── 16_dictionaries/
├── 17_comprehensions/
├── 18_oop_basics/
├── 19_modules_and_packages/
├── 20_file_handling/
├── 21_standard_library/
├── 22_regex/
├── 23_lambda_and_functional_tools/
├── 24_iterators_and_generators/
└── 25_decorators/

Getting Started: Core Topics

Explore the fundamental concepts of Python programming through the guides below. Each folder contains a concise explanation and short code examples:

Setup & Reference Material

  1. Environment and Tooling - Set up virtual environments and install packages with pip.
  2. Basic Syntax - Learn about Python indentation, statements, and blocks.
  3. Comments - Find out how to write single-line comments, multi-line comments, and docstrings.
  4. Tokens - Understand keywords, identifiers, literals, operators, and delimiters.

Language Fundamentals

  1. Variables and Data Types - Learn how variables are created and the primary data types.
  2. Operators - Explore mathematical, comparison, logical, and membership operators.
  3. Input and Output - Read values using input() and print output using print().
  4. Conditional Statements - Learn about decision making using if, elif, and else.
  5. Loops - Iterate using while and for loops.
  6. Functions - Learn how to define, call, and pass data to functions.
  7. Type Hints - Add code documentation and enable static type checking.
  8. Exception Handling - Learn to handle runtime errors using try-except-finally blocks.

Built-in Collections (Deep Dive)

  1. Strings (Deep Dive) - String slicing, indexing, and standard string methods.
  2. Lists (Deep Dive) - Changeable lists, slicing, copying, and nested structures.
  3. Tuples - Read-only ordered, immutable collections of items.
  4. Sets - Unordered, unindexed, duplicate-free mathematical collections.
  5. Dictionaries (Deep Dive) - Store key-value mappings, safe access, and merging.
  6. Comprehensions - Syntactic sugar for list, set, and dict construction.

Intermediate Concepts

  1. OOP Basics - Understand classes, objects, and the core pillars of OOP.
  2. Modules and Packages - Organize your codebase across multiple files and folders.
  3. File Handling - Learn to read, write, append, and delete files.
  4. Standard Library - Use built-in OS, random, sys, and collections modules.
  5. Regex - Pattern matching and text search using the re module.

Advanced Topics (Stretch Goals)

  1. Lambda and Functional Tools - Anonymous functions, maps, and filters.
  2. Iterators and Generators - Stream data collections efficiently to save memory.
  3. Decorators - Wrap and modify the behavior of functions dynamically.