The functions Python gives you without importing anything: sorted(), the numerical aggregations, all() and any(), and enumerate() for index and value together.
No account needed to read a lesson · 30-day money-back guarantee
See the full learning path6
lessons
46
practice questions
41
prerequisite lessons
1 of the 6 lessons here is free to preview - the whole explanation and worked example, with no account and no email.
The editor you get
A still of the editor, not a live one
Python Editor
Editor Output
Output:
[3, 7, 9] 9
You write and run Python in the browser - nothing to install, no setup. Questions are marked on the values your code produces. The snippet here is an example of the kind of code you write.
The 6 lessons in this unit. Expand any one to see what it covers. Each unlocks when its own prerequisites are passed.
01
Built-in functions
4 questions
Understand what built-in functions in Python are and see how to use the abs() function to find the absolute value of numbers regardless of their sign.
Covers
Overview of built-in functions
The abs() function
02
Sorting numbers and strings with sorted()
9 questions
Learn how to use Python's sorted() function to create sorted lists of numbers or strings in ascending or descending order, and see how case sensitivity affects the sorting of strings.
Covers
Sorting numbers
Sorting lists of strings
03
Built-in numerical aggregation functions
12 questions
Learn how to use Python's built-in min(), max(), and sum() functions to efficiently find the smallest, largest, and total values in collections of numbers.
Covers
The min() function
The max() function
The sum() function
04
The all() and any() functions
8 questions
Learn how to use Python's built-in all() and any() functions to determine whether all or any elements in an iterable are true, and understand the behaviour of these functions with different types of elements and empty iterables.
Covers
The all() function
The any() function
05
The enumerate() function
8 questions
Learn how the enumerate() function in Python allows simultaneous iteration over items and their indices, with the option to specify a custom starting index for the counter.
Covers
The enumerate() function
Specifying a starting value
06
Activity: treasure hunt
5 questions
Practise writing Python code to calculate distances, assign values and difficulty levels, interpret clues, and summarise locations in a treasure hunt scenario.
Covers
Distance to treasure
Treasure values
Treasure recovery difficulty
Treasure clues
Treasure hunt site summary
This unit is part of our Python Done Right learning path, which contains 100 lessons. Every one of them is drawn below.
The diagnostic test lets you skip any lesson you already know, including the ones in this unit.
Hover any dot to name its lesson.
6 lessons in this unit
41 prerequisite lessons across the unit, counting every step back to the start
53 other lessons in the learning path - after this unit, or alongside it
Builds on: Assorted extras, Basic data types, Comparisons, Lists, Loops, User-defined functions
Leads to: Comprehensions, Loops, User-defined functions
One subscription covers every learning path, and you can test out of anything you already know.
One subscription covers every learning path · 30-day money-back guarantee
More in Functions: User-defined functions