IIT Madras
Scholar Hub
Home
Tools
Resources
All tools
User guide
Python Cheatsheet
Find a function. Open an example. Copy and try it.
Grades
CGPA
ET Predictor
Resume
Resources
Search functions & examples
Browse a topic
All topics
1-35: Fundamental Python Built-ins
36-45: String and List Methods
46-85: Advanced & IITM Functions
Type Rules and Conversions
Pattern Printing Mastery
IITM Exam-Pro Tips
Tap a function to see its example
Fundamental Python Built-ins
Universal Core - Functions 1-35
1.
len()
Get the number of items in an object
2.
max()
Return the largest item
3.
min()
Return the smallest item
4.
sum()
Return the sum of all items
5.
sorted()
Return a sorted list
6.
reversed()
Return a reversed iterator
7.
enumerate()
Return index and value pairs
8.
range()
Generate a sequence of numbers
9.
all()
True if all items are True
10.
any()
True if any item is True
11.
zip()
Combine two iterables
12.
map()
Apply a function to each element
13.
filter()
Filter elements by condition
14.
abs()
Absolute value
15.
pow()
Power function
16.
round()
Round a floating point number
17.
divmod()
Return quotient and remainder
18.
type()
Get the type of an object
19.
id()
Return memory address of object
20.
isinstance()
Check if object is instance of class
21.
dir()
List available methods and attributes
22.
help()
Show documentation of object
23.
list() / tuple() / set() / dict()
Convert types
24.
int() / float() / str()
Type conversions
25.
eval()
Evaluate string as Python expression
26.
ord() / chr()
ASCII and character conversions
27.
bin() / oct() / hex()
Convert to binary, octal, hexadecimal
28.
input()
Get user input
29.
print()
Display output
30.
sorted(..., reverse=True)
Sort descending
31.
zip() + enumerate() Combination
Complex looping
32.
any() + all() with Conditions
Logical functions
33.
map(int, ...) with sum()
Convert and sum
34.
lambda
Anonymous function
35.
Combination Examples
Powerful one-liners