Closed BethanyG closed 2 years ago
This issue has been automatically marked as abandoned 🏚
because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
This issue has been automatically marked as abandoned 🏚
because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Closing in favor of #3107 and #3108.
This issue describes how to implement the
functional tools
concept exercise for the python track.Getting started
Please please please read the docs before starting. Posting PRs without reading these docs will be a lot more frustrating for you during the review cycle, and exhaust Exercism's maintainers' time. So, before diving into the implementation, please read up on the following documents:
Goal
This concept exercise is meant to teach an understanding/use of
functional tools
(e.g,map(), filter(), and functools.reduce()
in Python.Learning objectives
built-in map()
function.lambda
or callback function used as the argument.set
,dict
orlist
comprehensionsbuilt-in filter()
function.lambda
or callback function used as the argument.set
,dict
orlist
comprehensionsfunctools.reduce()
functionlambda
or callback function used as the argument.initializer
as a "first call" or to guard against TypeErrors when the passediterable
is empty.sum()
,min()
,max()
,any()
,all()
,math.prod()
and tointertools.accumulate()
Out of scope
comprehensions
comprehensions
inlambdas
map()
,filter()
orfunctools.reduce()
in acomprehension
functools
beyondfunctools.reduce()
(this will get its own exercise)generators
assignment expression
or "walrus" operator (:=
) in alambda
Concepts
built-ins
any()
&all()
sum()
min()
&max()
map()
filter()
functools.reduce()
itertools.accumulate()
Prerequisites
These are the concepts/concept exercises the student needs to complete/understand before solving this concept exercise.
basics
bools
comparisons
dicts
dict-methods
functions
function-arguments
higher-order-functions
iteration
lists
list-methods
numbers
sequences
sets
strings
string-methods
tuples
Resources to refer to
Python Docs: Defining Functions
Python Docs Tutorial: Lambda Expressions
Functions as Objects in Python
Composing Programs: Higher-Order Functions
Learn by Example: Python Lambda Function
built-ins: Python Docs
map()
&filter()
any()
&all()
min()
&max()
sum()
itertools.accumulate()
functools.reduce()
Real Python: Functional Programming in Python: When and How to Use it
Real Python : Python's map(): Processing Iterables Without a Loop
Real Python: Python's reduce(): From Functional to Pythonic Style
Pthon Docs: Functional Programming HOWTO
Hints
For more information on writing hints see hints
links.json
For more information, see concept links file
concepts/links.json
file, if it doesn't already exist.links.json
document.Concept Description
Please see the following for more details on these files: concepts & concept exercises
Concept
about.md
Concept file/issue: There is currently no issue or files for the concept. They are TBD.
For more information, see Concept
about.md
Concept
introduction.md
For more information, see Concept
introduction.md
Exercise
introduction.md
For more information, see Exercise
introduction.md
Test-runner
No changes required to the Python Test Runner at this time.
Representer
No changes required to the Python Representer at this time.
Analyzer
No changes required to the Python Analyzer at this time.
Exercise Metadata - Track
For more information on concept exercises and formatting for the Python track
config.json
, please see concept exercise metadata. The trackconfig.json
file can be found in the root of the Python repo.You can use the below for the exercise UUID. You can also generate a new one via exercism configlet, uuidgenerator.net, or any other favorite method. The UUID must be a valid V4 UUID.
Exercise Metadata Files Under
.meta/config.json
For more information on exercise
.meta/
files and formatting, see concept exercise metadata files.meta/config.json
- see this link for the fields and formatting of this file..meta/design.md
- see this link for the formatting of this file. Please use the Goal, Learning Objectives,Concepts, Prerequisites and , Out of Scope sections from this issue.Implementation Notes
.meta/examplar.py
file should only use syntax & concepts introduced in this exercise or one of its prerequisite exercises.unittest.TestCase
and the test file should be named<EXERCISE-NAME>_test.py
.Help
If you have any questions while implementing the exercise, please post the questions as comments in this issue, or contact one of the maintainers on our Slack channel.