Challenges
Accept a challenge, solve it against a quiet timer and earn up to three stars: fewer hints, more stars and more XP.
Start here
Hello World
Python Basics · Beginner · 25 XP
All challenges
- Hello WorldWrite a function called greet() that returns the string "Hello, World!".Python Basics · Beginner · about 2 min25 XP
- Simple MathWrite a function called add(a, b) that takes two numbers and returns their sum.Python Basics · Beginner · about 2 min25 XP
- Say HelloWrite a function called say_hello(name) that takes a person's name and returns a greeting string.Strings · Beginner · about 2 min25 XP
- Is Even?Write a function called is_even(n) that returns True if the number is even, and False if it's odd.Python Basics · Beginner · about 3 min30 XP
- Maximum of TwoWrite a function called max_of_two(a, b) that returns the larger of two numbers (without using Python's built-in max() function).Python Basics · Beginner · about 3 min30 XP
- Absolute ValueWrite a function called absolute(n) that returns the absolute value of a number (without using Python's built-in abs() function).Python Basics · Beginner · about 4 min35 XP
- Capitalize WordsWrite a function called capitalize_words(s) that capitalizes the first letter of each word in a string.Strings · Beginner · about 3 min35 XP
- Default ParametersWrite a function called greet_person(name, greeting="Hello") that creates a greeting message with an optional greeting word.Functions · Beginner · about 3 min35 XP
- Reverse a StringWrite a function called reverse_string(s) that returns the reversed version of the input string.Strings · Beginner · about 3 min40 XP
- Count ElementWrite a function called count_element(lst, element) that counts how many times an element appears in a list.Lists · Beginner · about 4 min40 XP
- Sum of ListWrite a function called sum_list(numbers) that returns the sum of all numbers in a list.Lists · Beginner · about 4 min40 XP
- Count VowelsWrite a function called count_vowels(s) that counts the number of vowels (a, e, i, o, u) in a string.Strings · Beginner · about 5 min45 XP
- Find MaximumWrite a function called find_max(numbers) that returns the largest number in a list.Lists · Beginner · about 5 min45 XP
- Reverse a ListWrite a function called reverse_list(lst) that returns a new list with elements in reverse order.Lists · Beginner · about 5 min45 XP
- Sum of DigitsWrite a function called sum_of_digits(n) that returns the sum of all digits in a non-negative integer.Loops · Intermediate · about 5 min55 XP
- Multiply All ArgumentsWrite a function called multiply_all(*args) that takes any number of arguments and returns their product (all multiplied together).Functions · Intermediate · about 5 min55 XP
- Palindrome CheckWrite a function called is_palindrome(s) that returns True if the string is a palindrome (reads the same forwards and backwards), and False otherwise.Strings · Intermediate · about 6 min60 XP
- Remove DuplicatesWrite a function called remove_duplicates(lst) that returns a new list with duplicate elements removed, preserving the original order.Lists · Intermediate · about 7 min60 XP
- FactorialWrite a function called factorial(n) that calculates the factorial of a non-negative integer n.Loops · Intermediate · about 6 min65 XP
- Custom FilterWrite a function called custom_filter(lst, func) that returns a new list containing only the elements for which the function returns True.Functions · Intermediate · about 6 min65 XP
- Fibonacci SequenceWrite a function called fibonacci(n) that returns a list of the first n Fibonacci numbers.Loops · Intermediate · about 7 min70 XP
- FizzBuzzThe classic programming challenge! Write a function called fizz_buzz(n) that returns a list of strings from 1 to n with the following rules:Loops · Intermediate · about 8 min75 XP
- Prime Number CheckWrite a function called is_prime(n) that returns True if n is a prime number, and False otherwise.Loops · Intermediate · about 8 min80 XP
- Function CompositionWrite a function called compose(f, g) that takes two functions and returns a new function that applies g first, then f.Functions · Advanced · about 8 min85 XP
- Memoization DecoratorWrite a function called memoize(func) that returns a memoized version of the input function. Memoization caches the results of function calls so repeated calls with the same arguments return the cached result.Functions · Advanced · about 10 min100 XP