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.
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.
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.
- 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
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/
Explore the fundamental concepts of Python programming through the guides below. Each folder contains a concise explanation and short code examples:
- Environment and Tooling - Set up virtual environments and install packages with pip.
- Basic Syntax - Learn about Python indentation, statements, and blocks.
- Comments - Find out how to write single-line comments, multi-line comments, and docstrings.
- Tokens - Understand keywords, identifiers, literals, operators, and delimiters.
- Variables and Data Types - Learn how variables are created and the primary data types.
- Operators - Explore mathematical, comparison, logical, and membership operators.
- Input and Output - Read values using
input()and print output usingprint(). - Conditional Statements - Learn about decision making using
if,elif, andelse. - Loops - Iterate using
whileandforloops. - Functions - Learn how to define, call, and pass data to functions.
- Type Hints - Add code documentation and enable static type checking.
- Exception Handling - Learn to handle runtime errors using try-except-finally blocks.
- Strings (Deep Dive) - String slicing, indexing, and standard string methods.
- Lists (Deep Dive) - Changeable lists, slicing, copying, and nested structures.
- Tuples - Read-only ordered, immutable collections of items.
- Sets - Unordered, unindexed, duplicate-free mathematical collections.
- Dictionaries (Deep Dive) - Store key-value mappings, safe access, and merging.
- Comprehensions - Syntactic sugar for list, set, and dict construction.
- OOP Basics - Understand classes, objects, and the core pillars of OOP.
- Modules and Packages - Organize your codebase across multiple files and folders.
- File Handling - Learn to read, write, append, and delete files.
- Standard Library - Use built-in OS, random, sys, and collections modules.
- Regex - Pattern matching and text search using the re module.
- Lambda and Functional Tools - Anonymous functions, maps, and filters.
- Iterators and Generators - Stream data collections efficiently to save memory.
- Decorators - Wrap and modify the behavior of functions dynamically.