lab challenge

Python Challenge: Accumulate

Beginner
20m
472
3.2/5
Get challenged in a real environmentProve your skills in a real-world, provisioned environment.
Push your limitsComplete an unguided mission within the time limit.
See resultsTest your problem-solving skills and track your progress.
Lab description

In this challenge, you will put your knowledge of the Python programming language to the test by implementing the accumulate operation, which, given a collection and an operation to perform on each element of the collection, returns a new collection containing the result of applying that operation to each element of the input collection.

Given the collection of numbers:

  • 1, 2, 3, 4, 5

And the operation:

  • square a number (x => x * x)

Your code should be able to produce the collection of squares:

  • 1, 4, 9, 16, 25

Check out the test suite to see the expected function signature.

Prerequisites
  • Knowledge of Python 3
Intended audience
  • Beginner Python developers
What will be assessed
  • Your ability to write Python code within a time-limited environment
About the author
Avatar
Logan Rakai, opens in a new tab
Lead Content Developer - Labs
Students
216,004
Labs
223
Courses
9
Learning paths
56

Logan has been involved in software development and research since 2007 and has been in the cloud since 2012. He is an AWS Certified DevOps Engineer - Professional, AWS Certified Solutions Architect - Professional, Microsoft Certified Azure Solutions Architect Expert, MCSE: Cloud Platform and Infrastructure, Google Cloud Certified Associate Cloud Engineer, Certified Kubernetes Security Specialist (CKS), Certified Kubernetes Administrator (CKA), Certified Kubernetes Application Developer (CKAD), and Certified OpenStack Administrator (COA). He earned his Ph.D. studying design automation and enjoys all things tech.

LinkedIn, Twitter, GitHub

Covered topics