Python Pandas Programs with Solutions

Python Practice › Pandas Programs

Python Pandas Programs with Solutions

95 programs95 easy0 medium0 hard

95 pandas programs: Series arithmetic and statistics, building and filtering DataFrames, sorting, adding and renaming columns, string methods, joining tables and handling missing values. Outputs come from pandas 3; the in-browser Try it uses an older pandas, so some printouts (such as column types) may differ slightly.

Before you start

Read the Pandas lesson first if the topic is new to you.

All programs

Python Tuple Programs with Solutions

Python Practice › Tuple Programs

Python Tuple Programs with Solutions

70 programs65 easy5 medium0 hard

70 tuple programs: creating, indexing, unpacking, sorting lists of tuples, converting between tuples, lists, strings and dicts, and filtering tuples by their contents. Each solution is explained and shows its real output.

Before you start

Read the Tuples and List vs Tuple lesson first if the topic is new to you.

All programs

Python If-Else Programs with Solutions

Python Practice › If-Else Programs

Python If-Else Programs with Solutions

64 programs59 easy5 medium0 hard

64 if-else programs that practise decisions in Python: comparisons, elif chains, nested conditions and combining tests with and / or. Each solution tests several inputs so you can see every branch run.

Before you start

Read the If…Else and Match Case lesson first if the topic is new to you.

All programs

Python Basic Programs with Solutions

Python Practice › Basic Programs

Python Basic Programs with Solutions

40 programs34 easy6 medium0 hard

Start here if you are new to Python. These 40 basic programs use only variables, arithmetic, a few built-in modules and print(), and each one comes with an explained solution you can run in the browser.

Before you start

Read the Variables and Numbers & Math and Operators & Booleans lesson first if the topic is new to you.

All programs

Python Function Programs with Solutions

Python Practice › Function Programs

Python Function Programs with Solutions

39 programs35 easy4 medium0 hard

39 function programs that practise defining functions, parameters, return values, *args, nested functions and small menu-driven systems. Each solution is written as a reusable function and tested with several inputs.

Before you start

Read the Functions and Lambda and Scope lesson first if the topic is new to you.

All programs

Python Dictionary Programs with Solutions

Python Practice › Dictionary Programs

Python Dictionary Programs with Solutions

94 programs91 easy3 medium0 hard

94 dictionary programs: adding, removing and renaming keys, merging, sorting by key or value, counting with dictionaries, grouping, inverting, and working with nested dictionaries and lists of dictionaries. Every solution is explained with its real output.

Before you start

Read the Dictionaries lesson first if the topic is new to you.

All programs

Python List Programs with Solutions

Python Practice › List Programs

Python List Programs with Solutions

100 programs93 easy7 medium0 hard

100 list programs, from sums and reversing to sublists, de-duplication and run-length decoding. Lists are Python’s most used data structure, and these exercises appear in most Python interviews. Every solution is explained and shows its real output.

Before you start

Read the Lists and List Comprehension lesson first if the topic is new to you.

All programs