This document provides a basic introduction to Python, covering fundamental concepts and syntax. It's intended for individuals new to programming or those seeking a starting point with Python.

1. Introduction

Python is a high-level, interpreted, general-purpose programming language known for its readability, versatility, and extensive libraries. It is widely used in various fields, including web development, data science, machine learning, scripting, and more.

2. Getting Started

To begin working with Python, you need a Python interpreter. This can be installed through the official Python website. Once installed, you can open a terminal or command prompt and type python to access the interactive interpreter.

3. Basic Syntax

Python uses a simple and consistent syntax:

4. Functions

Functions are blocks of reusable code that perform specific tasks. They are defined using the `def` keyword:

def greet(name):
"""Greets a user with their name."""
print("Hello, " + name + "!")

greet("Bob")

5. Modules and Libraries

Python's strength lies in its extensive libraries. Modules are files containing code that can be imported and used in other programs.

import math

print(math, sqrt(25))

This code imports the `math` module and uses its `sqrt` function to calculate the square root of 25.

6. Further Exploration

This document provided a basic overview of Python. For more advanced concepts and applications, explore resources such as: