Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Application to VIP Projects for dwc808 #54

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions application.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
def map(iterable, map_func) -> array:
"""
Takes an iterable data structure and function as paramaters and applies the function to all objects
in the iterable. Returns a new array with the resulting outputs.

:param iterable: an iterable object to be altered by the map function
:param map_func: the function to call on each element of the iterable
:return: a new array whose elements are the altered objects from the original iterable
"""

mapped_array = []

#iterate over original object, apply map_func to each and append outputs to mapped_array
for object in iterable:
mapped_array.append(map_func(object))

return mapped_array
Empty file added application_test.py
Empty file.