0% found this document useful (0 votes)
8 views2 pages

Python Programming Quick Reference Sheet

This document is a quick reference sheet for Python programming, covering essential topics such as basic syntax, data types, control structures, loops, functions, and object-oriented programming. It also includes examples of exception handling and mentions common libraries like NumPy and Pandas. The guide is designed for beginners and intermediate users to quickly refresh their Python knowledge.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
8 views2 pages

Python Programming Quick Reference Sheet

This document is a quick reference sheet for Python programming, covering essential topics such as basic syntax, data types, control structures, loops, functions, and object-oriented programming. It also includes examples of exception handling and mentions common libraries like NumPy and Pandas. The guide is designed for beginners and intermediate users to quickly refresh their Python knowledge.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

**Quick Reference Sheet for Python Programming**

Python is a widely used high-level, interpreted programming language known for its
simplicity and readability. This document provides a concise cheat sheet covering the
essentials for beginners and intermediate users.

**1. Basic Syntax**


```python
print("Hello, World!")
x=5
y = "AI"
```

**2. Data Types**


- int, float, str, bool
- list, tuple, set, dict

```python
my_list = [1, 2, 3]
my_dict = {"name": "Manjeet", "age": 19}
```

**3. Control Structures**


```python
if x > 0:
print("Positive")
elif x == 0:
print("Zero")
else:
print("Negative")
```

**4. Loops**
```python
for i in range(5):
print(i)
while x > 0:
x -= 1
```

**5. Functions**
```python
def greet(name):
return f"Hello, {name}"
```

**6. Lambda Functions**


```python
add = lambda a, b: a + b
```

**7. OOP Basics**


```python
class Car:
def __init__(self, brand):
self.brand = brand

def start(self):
print(f"{self.brand} started")
```

**8. Exception Handling**


```python
try:
x=1/0
except ZeroDivisionError:
print("Cannot divide by zero")
```

**9. Common Libraries**


- **NumPy**: numerical computing
- **Pandas**: data manipulation
- **Matplotlib**: visualization
- **scikit-learn**: machine learning

This reference guide is ideal for students, hobbyists, and professionals looking to refresh
Python knowledge quickly.

You might also like