Python Cheat Sheet
A quick reference for Python syntax, data structures, and common functions.
2 PagesBeginnerMay 20, 2026
Variables
Variables are used to store data values.
python
x = 10 # Integername = "SkillVeris" # Stringprice = 19.99 # Floatis_active = True # Boolean
Data Types
Python has the following built-in data types.
- int- Whole numbers
- float- Decimal numbers
- str- Text (string)
- bool- True or False
- list- Ordered collection
- tuple- Immutable ordered collection
- dict- Key-value pairs
- set- Unordered collection
List Operations
Common operations on lists.
python
fruits = ["apple", "banana", "cherry"]fruits.append("orange") # Add itemfruits.remove("banana") # Remove itemfirst = fruits[0] # Access itemlength = len(fruits) # Length of list
Dictionary Ops
Working with key-value pairs.
python
person = {"name": "Alice", "age": 30}person["email"] = "alice@example.com"name = person.get("name") # Get safelydel person["age"] # Delete keykeys = list(person.keys()) # All keys
Functions
Define reusable blocks of code.
python
def greet(name, greeting="Hello"): return f"{greeting}, {name}!"# Lambda (anonymous function)square = lambda x: x ** 2print(square(5)) # 25
Pro Tip
Use built-in functions and list comprehensions to write clean and efficient Python code.
Was this cheat sheet helpful?
Explore Topics
#Python#PythonCheatSheet#Programming#Beginner#Variables#DataTypes#ListOperations#DictionaryOps#Functions#CheatSheet#SkillVeris
Advertisement
Sri Hayavadhana Info-Tech
Professional Web Designing Services
- Responsive Websites
- E-commerce Solutions
- SEO Friendly Design
- Fast & Secure
- Support & Maintenance