Overview

Project details

A project to teach and implement lambda functions in Python.


Tracks: Python

155

number of points you will earn

2

launches to complete the project

4

tasks to complete the project

This project is part of the following tracks:

Learning outcomes

Understanding of lambda functions, practical applications in data manipulation, and familiarity with higher-order functions in Python.


Project Launches & Tasks

launch_1

  • task_1 (25 points)
    • Create a function called sort_list that takes a list of integers as an argument.
    • The function should return the list sorted in ascending order using a lambda function.
    • Implement this function in utils/sorting.py.
    • Add or update unit tests for sort_list in tests/test_sorting.py.
    • Do not forget to implement unit tests for sort_list function
  • task_2 (35 points)
    • Implement a function called filter_even_numbers that takes a list of integers and returns a new list containing only the even numbers using a lambda function.
    • This function should be located in utils/filtering.py.
    • Add or update unit tests for filter_even_numbers in tests/test_filtering.py.
    • Do not forget to implement unit tests for filter_even_numbers function

launch_2

  • task_3 (45 points)
    • Create a function called map_square that takes a list of integers and returns a new list with the squares of each number using a lambda function with map.
    • This function should be implemented in utils/mapping.py.
    • Add or update unit tests for map_square in tests/test_mapping.py.
    • Do not forget to implement unit tests for map_square function
  • task_4 (50 points)
    • Implement a function called sort_by_length that takes a list of strings and returns the list sorted by the length of each string using a lambda function.
    • This function should be located in utils/sort_by_length.py.
    • Add or update unit tests for sort_by_length in tests/test_sort_by_length.py.
    • Do not forget to implement unit tests for sort_by_length function
Log in to launch project