PythonPedia

Master Python Programming

Comprehensive guide to Python programming language by TV Small Company

About Python

Python is an interpreted, high-level, general-purpose programming language. Created by Guido van Rossum and first released in 1991, Python's design philosophy emphasizes code readability with its notable use of significant whitespace.

Python is dynamically typed and garbage-collected. It supports multiple programming paradigms, including structured (particularly procedural), object-oriented, and functional programming.

"Python is powerful... and fast; plays well with others; runs everywhere; is friendly & easy to learn; is Open."

Python Code

Python Syntax Basics

Variables

# Variable assignment
x = 5
y = "Hello, World!"
z = [1, 2, 3]

Functions

# Function definition
def greet(name):
    return f"Hello, {name}!"

# Function call
print(greet("Alice"))

Loops

# For loop
for i in range(5):
    print(i)

# While loop
count = 0
while count < 5:
    print(count)
    count += 1

Conditionals

# If-elif-else
age = 18
if age < 13:
    print("Child")
elif age < 18:
    print("Teen")
else:
    print("Adult")

Popular Python Libraries

NumPy

Fundamental package for scientific computing with Python. It provides support for arrays, matrices, and many mathematical functions.

Pandas

Provides high-performance, easy-to-use data structures and data analysis tools for Python programming language.

TensorFlow

An end-to-end open source platform for machine learning that makes it easy for beginners and experts to create machine learning models.

Django

A high-level Python Web framework that encourages rapid development and clean, pragmatic design.

Matplotlib

A comprehensive library for creating static, animated, and interactive visualizations in Python.

SQLAlchemy

The Python SQL toolkit and Object Relational Mapper that gives application developers the full power and flexibility of SQL.