From 29478dd68ccc1c50c0fe4dd36e4b8b1bf5e24e7a Mon Sep 17 00:00:00 2001 From: Michael Morehouse <640167+yawpitch@users.noreply.github.com> Date: Thu, 5 Mar 2020 20:46:17 +0000 Subject: [PATCH] Organize concepts, eliminate duplication * Stage 1 * Finish restructuring, add checkboxes. * Minor format fixes * fixing broken link * fixing broken link * fixing README link * Fix multiples bad links * Fix links in reference/concepts/keywords/README.md * Correcting list description --- reference/concepts/argument_unpacking.md | 6 +++++ .../concepts/arguments_and_parameters.md | 10 +++++++++ reference/concepts/assignment.md | 8 +++++++ reference/concepts/binary_numbers.md | 5 +++++ reference/concepts/bitflags.md | 5 +++++ reference/concepts/bitwise_operators.md | 6 +++++ reference/concepts/boolean_operators.md | 7 ++++++ reference/concepts/boolean_values.md | 6 +++++ reference/concepts/booleans_are_integers.md | 5 +++++ reference/concepts/bracket_notation.md | 5 +++++ .../concepts/builtin_functions/__import__.md | 7 ++++++ reference/concepts/builtin_functions/abs.md | 7 ++++++ reference/concepts/builtin_functions/all.md | 7 ++++++ reference/concepts/builtin_functions/any.md | 7 ++++++ reference/concepts/builtin_functions/ascii.md | 7 ++++++ reference/concepts/builtin_functions/bin.md | 7 ++++++ .../concepts/builtin_functions/breakpoint.md | 7 ++++++ .../concepts/builtin_functions/callable.md | 7 ++++++ reference/concepts/builtin_functions/chr.md | 7 ++++++ .../concepts/builtin_functions/classmethod.md | 7 ++++++ .../concepts/builtin_functions/compile.md | 7 ++++++ .../concepts/builtin_functions/delattr.md | 7 ++++++ reference/concepts/builtin_functions/dir.md | 7 ++++++ .../concepts/builtin_functions/divmod.md | 7 ++++++ .../concepts/builtin_functions/enumerate.md | 10 +++++++++ reference/concepts/builtin_functions/eval.md | 7 ++++++ reference/concepts/builtin_functions/exec.md | 7 ++++++ .../concepts/builtin_functions/filter.md | 7 ++++++ .../concepts/builtin_functions/format.md | 7 ++++++ .../concepts/builtin_functions/getattr.md | 7 ++++++ .../concepts/builtin_functions/globals.md | 7 ++++++ .../concepts/builtin_functions/hasattr.md | 7 ++++++ reference/concepts/builtin_functions/hash.md | 7 ++++++ reference/concepts/builtin_functions/help.md | 7 ++++++ reference/concepts/builtin_functions/hex.md | 7 ++++++ reference/concepts/builtin_functions/id.md | 7 ++++++ reference/concepts/builtin_functions/input.md | 7 ++++++ .../concepts/builtin_functions/isinstance.md | 7 ++++++ .../concepts/builtin_functions/issubclass.md | 7 ++++++ reference/concepts/builtin_functions/iter.md | 7 ++++++ reference/concepts/builtin_functions/len.md | 12 ++++++++++ .../concepts/builtin_functions/locals.md | 7 ++++++ reference/concepts/builtin_functions/map.md | 7 ++++++ reference/concepts/builtin_functions/max.md | 10 +++++++++ reference/concepts/builtin_functions/min.md | 10 +++++++++ reference/concepts/builtin_functions/next.md | 7 ++++++ reference/concepts/builtin_functions/oct.md | 7 ++++++ reference/concepts/builtin_functions/open.md | 7 ++++++ reference/concepts/builtin_functions/ord.md | 7 ++++++ reference/concepts/builtin_functions/pow.md | 7 ++++++ reference/concepts/builtin_functions/print.md | 7 ++++++ reference/concepts/builtin_functions/repr.md | 7 ++++++ .../concepts/builtin_functions/reversed.md | 7 ++++++ reference/concepts/builtin_functions/round.md | 7 ++++++ .../concepts/builtin_functions/setattr.md | 7 ++++++ .../concepts/builtin_functions/sorted.md | 7 ++++++ .../builtin_functions/staticmethod.md | 7 ++++++ reference/concepts/builtin_functions/sum.md | 10 +++++++++ reference/concepts/builtin_functions/super.md | 7 ++++++ reference/concepts/builtin_functions/vars.md | 7 ++++++ reference/concepts/builtin_functions/zip.md | 12 ++++++++++ reference/concepts/builtin_types/bool.md | 10 +++++++++ reference/concepts/builtin_types/bytearray.md | 13 +++++++++++ reference/concepts/builtin_types/bytes.md | 11 ++++++++++ reference/concepts/builtin_types/complex.md | 8 +++++++ reference/concepts/builtin_types/dict.md | 16 ++++++++++++++ reference/concepts/builtin_types/float.md | 11 ++++++++++ reference/concepts/builtin_types/frozenset.md | 11 ++++++++++ reference/concepts/builtin_types/int.md | 13 +++++++++++ reference/concepts/builtin_types/list.md | 22 +++++++++++++++++++ .../concepts/builtin_types/memoryview.md | 7 ++++++ reference/concepts/builtin_types/object.md | 6 +++++ reference/concepts/builtin_types/property.md | 7 ++++++ reference/concepts/builtin_types/range.md | 15 +++++++++++++ reference/concepts/builtin_types/set.md | 10 +++++++++ reference/concepts/builtin_types/slice.md | 8 +++++++ reference/concepts/builtin_types/str.md | 17 ++++++++++++++ reference/concepts/builtin_types/tuple.md | 10 +++++++++ reference/concepts/builtin_types/type.md | 8 +++++++ reference/concepts/call_semantics.md | 5 +++++ reference/concepts/class_attributes.md | 3 +++ reference/concepts/class_composition.md | 5 +++++ reference/concepts/class_inheritance.md | 7 ++++++ reference/concepts/class_members.md | 5 +++++ reference/concepts/class_methods.md | 5 +++++ reference/concepts/comparison_operators.md | 6 +++++ reference/concepts/comprehension_syntax.md | 6 +++++ reference/concepts/conditional_structures.md | 6 +++++ reference/concepts/constants.md | 6 +++++ reference/concepts/constructor.md | 6 +++++ reference/concepts/custom_classes.md | 10 +++++++++ reference/concepts/data_structures.md | 5 +++++ reference/concepts/decorators.md | 5 +++++ .../decorators_as_higher_order_functions.md | 5 +++++ reference/concepts/default_arguments.md | 5 +++++ reference/concepts/dict_comprehension.md | 5 +++++ reference/concepts/docstrings.md | 5 +++++ reference/concepts/duck_typing.md | 6 +++++ reference/concepts/dunder_methods.md | 10 +++++++++ reference/concepts/dynamic_typing.md | 5 +++++ reference/concepts/enumerated_values.md | 5 +++++ reference/concepts/equality_operator.md | 5 +++++ reference/concepts/equivalence.md | 5 +++++ reference/concepts/everything_is_an_object.md | 5 +++++ reference/concepts/exception_catching.md | 5 +++++ reference/concepts/exception_handling.md | 5 +++++ reference/concepts/exception_hierarchy.md | 5 +++++ reference/concepts/exception_message.md | 6 +++++ reference/concepts/exceptions.md | 3 +++ reference/concepts/expressions.md | 5 +++++ reference/concepts/for_loops.md | 7 ++++++ reference/concepts/function_definition.md | 7 ++++++ reference/concepts/function_signature.md | 5 +++++ reference/concepts/generator_comprehension.md | 7 ++++++ reference/concepts/generators.md | 5 +++++ reference/concepts/identity_testing.md | 5 +++++ reference/concepts/immutability.md | 6 +++++ reference/concepts/implicit_self.md | 9 ++++++++ reference/concepts/importing.md | 7 ++++++ reference/concepts/indexing.md | 7 ++++++ reference/concepts/inequality.md | 5 +++++ reference/concepts/initialization.md | 5 +++++ reference/concepts/instance_attributes.md | 5 +++++ reference/concepts/instance_methods.md | 9 ++++++++ reference/concepts/instance_properties.md | 5 +++++ reference/concepts/instantiation.md | 6 +++++ reference/concepts/integer_comparison.md | 5 +++++ reference/concepts/iterables.md | 8 +++++++ reference/concepts/iteration.md | 7 ++++++ reference/concepts/iterators.md | 5 +++++ reference/concepts/keyword_only_parameters.md | 3 +++ reference/concepts/keyword_parameters.md | 3 +++ reference/concepts/keywords/and.md | 8 +++++++ reference/concepts/keywords/as.md | 7 ++++++ reference/concepts/keywords/assert.md | 8 +++++++ reference/concepts/keywords/async.md | 8 +++++++ reference/concepts/keywords/await.md | 8 +++++++ reference/concepts/keywords/break.md | 8 +++++++ reference/concepts/keywords/class.md | 8 +++++++ reference/concepts/keywords/continue.md | 8 +++++++ reference/concepts/keywords/def.md | 8 +++++++ reference/concepts/keywords/del.md | 8 +++++++ reference/concepts/keywords/elif.md | 7 ++++++ reference/concepts/keywords/else.md | 7 ++++++ reference/concepts/keywords/except.md | 7 ++++++ reference/concepts/keywords/false.md | 8 +++++++ reference/concepts/keywords/finally.md | 7 ++++++ reference/concepts/keywords/for.md | 8 +++++++ reference/concepts/keywords/from.md | 7 ++++++ reference/concepts/keywords/global.md | 8 +++++++ reference/concepts/keywords/if.md | 8 +++++++ reference/concepts/keywords/import.md | 8 +++++++ reference/concepts/keywords/in.md | 8 +++++++ reference/concepts/keywords/is.md | 8 +++++++ reference/concepts/keywords/lambda.md | 8 +++++++ reference/concepts/keywords/none.md | 14 ++++++++++++ reference/concepts/keywords/nonlocal.md | 8 +++++++ reference/concepts/keywords/not.md | 8 +++++++ reference/concepts/keywords/or.md | 8 +++++++ reference/concepts/keywords/pass.md | 8 +++++++ reference/concepts/keywords/raise.md | 8 +++++++ reference/concepts/keywords/return.md | 8 +++++++ reference/concepts/keywords/true.md | 8 +++++++ reference/concepts/keywords/try.md | 8 +++++++ reference/concepts/keywords/while.md | 8 +++++++ reference/concepts/keywords/with.md | 8 +++++++ reference/concepts/keywords/yield.md | 8 +++++++ reference/concepts/list_comprehension.md | 5 +++++ reference/concepts/list_methods.md | 5 +++++ reference/concepts/lookup_efficiency.md | 5 +++++ reference/concepts/membership_testing.md | 7 ++++++ reference/concepts/method_overloading.md | 5 +++++ reference/concepts/modular_division.md | 6 +++++ reference/concepts/multiple_assignment.md | 5 +++++ reference/concepts/mutability.md | 6 +++++ reference/concepts/namespaces.md | 6 +++++ reference/concepts/non_public_methods.md | 5 +++++ reference/concepts/operator_overloading.md | 5 +++++ reference/concepts/operator_precedence.md | 5 +++++ reference/concepts/operators.md | 5 +++++ reference/concepts/order_of_evaluation.md | 5 +++++ .../concepts/positional_only_parameters.md | 3 +++ reference/concepts/positional_parameters.md | 3 +++ reference/concepts/powers_of_two.md | 5 +++++ reference/concepts/property_decorator.md | 6 +++++ reference/concepts/raise.md | 7 ++++++ reference/concepts/recursion.md | 5 +++++ .../concepts/recursive_data_structures.md | 8 +++++++ reference/concepts/regular_expressions.md | 10 +++++++++ reference/concepts/return_value.md | 13 +++++++++++ reference/concepts/rich_comparison_methods.md | 5 +++++ reference/concepts/set_comprehension.md | 5 +++++ reference/concepts/short_circuiting.md | 5 +++++ reference/concepts/slicing.md | 7 ++++++ reference/concepts/standard_library.md | 5 +++++ reference/concepts/star_args.md | 3 +++ reference/concepts/star_star_kwargs.md | 3 +++ reference/concepts/static_methods.md | 5 +++++ reference/concepts/string_formatting.md | 5 +++++ reference/concepts/string_methods.md | 6 +++++ reference/concepts/string_splitting.md | 6 +++++ reference/concepts/string_translation.md | 5 +++++ reference/concepts/tuple_unpacking.md | 6 +++++ reference/concepts/type_conversion.md | 5 +++++ reference/concepts/type_hinting.md | 5 +++++ reference/concepts/while_loops.md | 5 +++++ 206 files changed, 1442 insertions(+) create mode 100644 reference/concepts/argument_unpacking.md create mode 100644 reference/concepts/arguments_and_parameters.md create mode 100644 reference/concepts/assignment.md create mode 100644 reference/concepts/binary_numbers.md create mode 100644 reference/concepts/bitflags.md create mode 100644 reference/concepts/bitwise_operators.md create mode 100644 reference/concepts/boolean_operators.md create mode 100644 reference/concepts/boolean_values.md create mode 100644 reference/concepts/booleans_are_integers.md create mode 100644 reference/concepts/bracket_notation.md create mode 100644 reference/concepts/builtin_functions/__import__.md create mode 100644 reference/concepts/builtin_functions/abs.md create mode 100644 reference/concepts/builtin_functions/all.md create mode 100644 reference/concepts/builtin_functions/any.md create mode 100644 reference/concepts/builtin_functions/ascii.md create mode 100644 reference/concepts/builtin_functions/bin.md create mode 100644 reference/concepts/builtin_functions/breakpoint.md create mode 100644 reference/concepts/builtin_functions/callable.md create mode 100644 reference/concepts/builtin_functions/chr.md create mode 100644 reference/concepts/builtin_functions/classmethod.md create mode 100644 reference/concepts/builtin_functions/compile.md create mode 100644 reference/concepts/builtin_functions/delattr.md create mode 100644 reference/concepts/builtin_functions/dir.md create mode 100644 reference/concepts/builtin_functions/divmod.md create mode 100644 reference/concepts/builtin_functions/enumerate.md create mode 100644 reference/concepts/builtin_functions/eval.md create mode 100644 reference/concepts/builtin_functions/exec.md create mode 100644 reference/concepts/builtin_functions/filter.md create mode 100644 reference/concepts/builtin_functions/format.md create mode 100644 reference/concepts/builtin_functions/getattr.md create mode 100644 reference/concepts/builtin_functions/globals.md create mode 100644 reference/concepts/builtin_functions/hasattr.md create mode 100644 reference/concepts/builtin_functions/hash.md create mode 100644 reference/concepts/builtin_functions/help.md create mode 100644 reference/concepts/builtin_functions/hex.md create mode 100644 reference/concepts/builtin_functions/id.md create mode 100644 reference/concepts/builtin_functions/input.md create mode 100644 reference/concepts/builtin_functions/isinstance.md create mode 100644 reference/concepts/builtin_functions/issubclass.md create mode 100644 reference/concepts/builtin_functions/iter.md create mode 100644 reference/concepts/builtin_functions/len.md create mode 100644 reference/concepts/builtin_functions/locals.md create mode 100644 reference/concepts/builtin_functions/map.md create mode 100644 reference/concepts/builtin_functions/max.md create mode 100644 reference/concepts/builtin_functions/min.md create mode 100644 reference/concepts/builtin_functions/next.md create mode 100644 reference/concepts/builtin_functions/oct.md create mode 100644 reference/concepts/builtin_functions/open.md create mode 100644 reference/concepts/builtin_functions/ord.md create mode 100644 reference/concepts/builtin_functions/pow.md create mode 100644 reference/concepts/builtin_functions/print.md create mode 100644 reference/concepts/builtin_functions/repr.md create mode 100644 reference/concepts/builtin_functions/reversed.md create mode 100644 reference/concepts/builtin_functions/round.md create mode 100644 reference/concepts/builtin_functions/setattr.md create mode 100644 reference/concepts/builtin_functions/sorted.md create mode 100644 reference/concepts/builtin_functions/staticmethod.md create mode 100644 reference/concepts/builtin_functions/sum.md create mode 100644 reference/concepts/builtin_functions/super.md create mode 100644 reference/concepts/builtin_functions/vars.md create mode 100644 reference/concepts/builtin_functions/zip.md create mode 100644 reference/concepts/builtin_types/bool.md create mode 100644 reference/concepts/builtin_types/bytearray.md create mode 100644 reference/concepts/builtin_types/bytes.md create mode 100644 reference/concepts/builtin_types/complex.md create mode 100644 reference/concepts/builtin_types/dict.md create mode 100644 reference/concepts/builtin_types/float.md create mode 100644 reference/concepts/builtin_types/frozenset.md create mode 100644 reference/concepts/builtin_types/int.md create mode 100644 reference/concepts/builtin_types/list.md create mode 100644 reference/concepts/builtin_types/memoryview.md create mode 100644 reference/concepts/builtin_types/object.md create mode 100644 reference/concepts/builtin_types/property.md create mode 100644 reference/concepts/builtin_types/range.md create mode 100644 reference/concepts/builtin_types/set.md create mode 100644 reference/concepts/builtin_types/slice.md create mode 100644 reference/concepts/builtin_types/str.md create mode 100644 reference/concepts/builtin_types/tuple.md create mode 100644 reference/concepts/builtin_types/type.md create mode 100644 reference/concepts/call_semantics.md create mode 100644 reference/concepts/class_attributes.md create mode 100644 reference/concepts/class_composition.md create mode 100644 reference/concepts/class_inheritance.md create mode 100644 reference/concepts/class_members.md create mode 100644 reference/concepts/class_methods.md create mode 100644 reference/concepts/comparison_operators.md create mode 100644 reference/concepts/comprehension_syntax.md create mode 100644 reference/concepts/conditional_structures.md create mode 100644 reference/concepts/constants.md create mode 100644 reference/concepts/constructor.md create mode 100644 reference/concepts/custom_classes.md create mode 100644 reference/concepts/data_structures.md create mode 100644 reference/concepts/decorators.md create mode 100644 reference/concepts/decorators_as_higher_order_functions.md create mode 100644 reference/concepts/default_arguments.md create mode 100644 reference/concepts/dict_comprehension.md create mode 100644 reference/concepts/docstrings.md create mode 100644 reference/concepts/duck_typing.md create mode 100644 reference/concepts/dunder_methods.md create mode 100644 reference/concepts/dynamic_typing.md create mode 100644 reference/concepts/enumerated_values.md create mode 100644 reference/concepts/equality_operator.md create mode 100644 reference/concepts/equivalence.md create mode 100644 reference/concepts/everything_is_an_object.md create mode 100644 reference/concepts/exception_catching.md create mode 100644 reference/concepts/exception_handling.md create mode 100644 reference/concepts/exception_hierarchy.md create mode 100644 reference/concepts/exception_message.md create mode 100644 reference/concepts/exceptions.md create mode 100644 reference/concepts/expressions.md create mode 100644 reference/concepts/for_loops.md create mode 100644 reference/concepts/function_definition.md create mode 100644 reference/concepts/function_signature.md create mode 100644 reference/concepts/generator_comprehension.md create mode 100644 reference/concepts/generators.md create mode 100644 reference/concepts/identity_testing.md create mode 100644 reference/concepts/immutability.md create mode 100644 reference/concepts/implicit_self.md create mode 100644 reference/concepts/importing.md create mode 100644 reference/concepts/indexing.md create mode 100644 reference/concepts/inequality.md create mode 100644 reference/concepts/initialization.md create mode 100644 reference/concepts/instance_attributes.md create mode 100644 reference/concepts/instance_methods.md create mode 100644 reference/concepts/instance_properties.md create mode 100644 reference/concepts/instantiation.md create mode 100644 reference/concepts/integer_comparison.md create mode 100644 reference/concepts/iterables.md create mode 100644 reference/concepts/iteration.md create mode 100644 reference/concepts/iterators.md create mode 100644 reference/concepts/keyword_only_parameters.md create mode 100644 reference/concepts/keyword_parameters.md create mode 100644 reference/concepts/keywords/and.md create mode 100644 reference/concepts/keywords/as.md create mode 100644 reference/concepts/keywords/assert.md create mode 100644 reference/concepts/keywords/async.md create mode 100644 reference/concepts/keywords/await.md create mode 100644 reference/concepts/keywords/break.md create mode 100644 reference/concepts/keywords/class.md create mode 100644 reference/concepts/keywords/continue.md create mode 100644 reference/concepts/keywords/def.md create mode 100644 reference/concepts/keywords/del.md create mode 100644 reference/concepts/keywords/elif.md create mode 100644 reference/concepts/keywords/else.md create mode 100644 reference/concepts/keywords/except.md create mode 100644 reference/concepts/keywords/false.md create mode 100644 reference/concepts/keywords/finally.md create mode 100644 reference/concepts/keywords/for.md create mode 100644 reference/concepts/keywords/from.md create mode 100644 reference/concepts/keywords/global.md create mode 100644 reference/concepts/keywords/if.md create mode 100644 reference/concepts/keywords/import.md create mode 100644 reference/concepts/keywords/in.md create mode 100644 reference/concepts/keywords/is.md create mode 100644 reference/concepts/keywords/lambda.md create mode 100644 reference/concepts/keywords/none.md create mode 100644 reference/concepts/keywords/nonlocal.md create mode 100644 reference/concepts/keywords/not.md create mode 100644 reference/concepts/keywords/or.md create mode 100644 reference/concepts/keywords/pass.md create mode 100644 reference/concepts/keywords/raise.md create mode 100644 reference/concepts/keywords/return.md create mode 100644 reference/concepts/keywords/true.md create mode 100644 reference/concepts/keywords/try.md create mode 100644 reference/concepts/keywords/while.md create mode 100644 reference/concepts/keywords/with.md create mode 100644 reference/concepts/keywords/yield.md create mode 100644 reference/concepts/list_comprehension.md create mode 100644 reference/concepts/list_methods.md create mode 100644 reference/concepts/lookup_efficiency.md create mode 100644 reference/concepts/membership_testing.md create mode 100644 reference/concepts/method_overloading.md create mode 100644 reference/concepts/modular_division.md create mode 100644 reference/concepts/multiple_assignment.md create mode 100644 reference/concepts/mutability.md create mode 100644 reference/concepts/namespaces.md create mode 100644 reference/concepts/non_public_methods.md create mode 100644 reference/concepts/operator_overloading.md create mode 100644 reference/concepts/operator_precedence.md create mode 100644 reference/concepts/operators.md create mode 100644 reference/concepts/order_of_evaluation.md create mode 100644 reference/concepts/positional_only_parameters.md create mode 100644 reference/concepts/positional_parameters.md create mode 100644 reference/concepts/powers_of_two.md create mode 100644 reference/concepts/property_decorator.md create mode 100644 reference/concepts/raise.md create mode 100644 reference/concepts/recursion.md create mode 100644 reference/concepts/recursive_data_structures.md create mode 100644 reference/concepts/regular_expressions.md create mode 100644 reference/concepts/return_value.md create mode 100644 reference/concepts/rich_comparison_methods.md create mode 100644 reference/concepts/set_comprehension.md create mode 100644 reference/concepts/short_circuiting.md create mode 100644 reference/concepts/slicing.md create mode 100644 reference/concepts/standard_library.md create mode 100644 reference/concepts/star_args.md create mode 100644 reference/concepts/star_star_kwargs.md create mode 100644 reference/concepts/static_methods.md create mode 100644 reference/concepts/string_formatting.md create mode 100644 reference/concepts/string_methods.md create mode 100644 reference/concepts/string_splitting.md create mode 100644 reference/concepts/string_translation.md create mode 100644 reference/concepts/tuple_unpacking.md create mode 100644 reference/concepts/type_conversion.md create mode 100644 reference/concepts/type_hinting.md create mode 100644 reference/concepts/while_loops.md diff --git a/reference/concepts/argument_unpacking.md b/reference/concepts/argument_unpacking.md new file mode 100644 index 00000000..fdeda9f5 --- /dev/null +++ b/reference/concepts/argument_unpacking.md @@ -0,0 +1,6 @@ +# Argument unpacking + +TODO: ADD MORE + +- the example solution for this exercise uses `splat` (`*`) to unpack rows for the `zip()` function. [matrix](../exercise-concepts/matrix.md) + diff --git a/reference/concepts/arguments_and_parameters.md b/reference/concepts/arguments_and_parameters.md new file mode 100644 index 00000000..115b8ade --- /dev/null +++ b/reference/concepts/arguments_and_parameters.md @@ -0,0 +1,10 @@ +# Arguments & parameters + +TODO: ADD MORE + +- Parameters passed into a function. In python, these are noted in the `()` following a function name. The example code uses a function named `to_rna()` with an argument of `dna_strand`. [rna-transcription](../exercise-concepts/rna-transcription.md) +- The example solutions use functions that take function arguments to operate on passed in markdown strings. [markdown](../exercise-concepts/markdown.md) +- the exercise requires a single positional parameter in the function signature [leap](../exercise-concepts/leap.md) +- concept over arguments of a function and how to use them is required [variable-length-quantity](../exercise-concepts/variable-length-quantity.md) +- the methods returning "row" and "column" need to take both `self` and an integer as arguments [matrix](../exercise-concepts/matrix.md) +- the example `__init__` method has `self`, direction, x, and y (coordinates) as parameters. It also uses `self` and `commands` (a string) for parameters of the `move()` method. [robot-simulator](../exercise-concepts/robot-simulator.md) diff --git a/reference/concepts/assignment.md b/reference/concepts/assignment.md new file mode 100644 index 00000000..ed9ac943 --- /dev/null +++ b/reference/concepts/assignment.md @@ -0,0 +1,8 @@ +# Assignment + +TODO: ADD MORE + +- The example solution uses assignment for variables and other values. [markdown](../exercise-concepts/markdown.md) +- instance properties need to be assigned passed in data [matrix](../exercise-concepts/matrix.md) +- the example uses assignment for all the instance properties and `instructions` dictionary. [robot-simulator](../exercise-concepts/robot-simulator.md) + diff --git a/reference/concepts/binary_numbers.md b/reference/concepts/binary_numbers.md new file mode 100644 index 00000000..0833dc5b --- /dev/null +++ b/reference/concepts/binary_numbers.md @@ -0,0 +1,5 @@ +# Binary numbers + +TODO: ADD MORE + +- binary numbers are a core important concept for this exercise [variable-length-quantity](../exercise-concepts/variable-length-quantity.md) diff --git a/reference/concepts/bitflags.md b/reference/concepts/bitflags.md new file mode 100644 index 00000000..ca515854 --- /dev/null +++ b/reference/concepts/bitflags.md @@ -0,0 +1,5 @@ +# Bitflags + +TODO: ADD MORE + +- a general understanding of bitflags is required to solve this exercise [allergies](../exercise-concepts/allergies.md) diff --git a/reference/concepts/bitwise_operators.md b/reference/concepts/bitwise_operators.md new file mode 100644 index 00000000..833fabb6 --- /dev/null +++ b/reference/concepts/bitwise_operators.md @@ -0,0 +1,6 @@ +# Bitwise operators + +TODO: ADD MORE + +- this exercise relies on bitwise AND (`&`) and potentially bitwise LSHIFT (`<<`) to inspect the Boolean value of individual bits in a bitflag [allergies](../exercise-concepts/allergies.md) +- bitwise operators such as `<<`, `>>`, `&`, `|`, `~`, `^` are central to this exercise [variable-length-quantity](../exercise-concepts/variable-length-quantity.md) diff --git a/reference/concepts/boolean_operators.md b/reference/concepts/boolean_operators.md new file mode 100644 index 00000000..23fd0b28 --- /dev/null +++ b/reference/concepts/boolean_operators.md @@ -0,0 +1,7 @@ +# Boolean operators + +TODO: ADD MORE + +- the exercise relies on `and`, `or`, and (optionally) `not` to form Boolean predicates [leap](../exercise-concepts/leap.md) +- the exercise relies on `and` and `or` to combine Boolean predicates into a single logical answer [leap](../exercise-concepts/leap.md) +- the `or` and `and` keywords are used [phone-number](../exercise-concepts/phone-number.md) diff --git a/reference/concepts/boolean_values.md b/reference/concepts/boolean_values.md new file mode 100644 index 00000000..40bce78e --- /dev/null +++ b/reference/concepts/boolean_values.md @@ -0,0 +1,6 @@ +# Boolean values + +TODO: ADD MORE + +- this solution uses Boolean values (`True` / `False`) [hamming](../exercise-concepts/hamming.md) +- True and False of type `bopl`. The example solution uses `True` and `False` as return values from functions that test membership in a list of values. [markdown](../exercise-concepts/markdown.md) diff --git a/reference/concepts/booleans_are_integers.md b/reference/concepts/booleans_are_integers.md new file mode 100644 index 00000000..817b23bc --- /dev/null +++ b/reference/concepts/booleans_are_integers.md @@ -0,0 +1,5 @@ +# Booleans are integers + +TODO: ADD MORE + +- Booleans values are just named aliases for the integers 1 (`True`) and 0 (`False`) [hamming](../exercise-concepts/hamming.md) diff --git a/reference/concepts/bracket_notation.md b/reference/concepts/bracket_notation.md new file mode 100644 index 00000000..f7f00b89 --- /dev/null +++ b/reference/concepts/bracket_notation.md @@ -0,0 +1,5 @@ +# Bracket notation + +TODO: ADD MORE + +- knowing that `[]` should be used to refer to a value at a specific index in a list [matrix](../exercise-concepts/matrix.md) diff --git a/reference/concepts/builtin_functions/__import__.md b/reference/concepts/builtin_functions/__import__.md new file mode 100644 index 00000000..a5d63882 --- /dev/null +++ b/reference/concepts/builtin_functions/__import__.md @@ -0,0 +1,7 @@ +# `__import__` + +TODO: ADD MORE DETAIL + +See [docs][docs]. + +[docs]: https://docs.python.org/3/library/functions.html#__import__ diff --git a/reference/concepts/builtin_functions/abs.md b/reference/concepts/builtin_functions/abs.md new file mode 100644 index 00000000..247d4c66 --- /dev/null +++ b/reference/concepts/builtin_functions/abs.md @@ -0,0 +1,7 @@ +# `abs` + +TODO: ADD MORE DETAIL + +See [docs][docs]. + +[docs]: https://docs.python.org/3/library/functions.html#abs diff --git a/reference/concepts/builtin_functions/all.md b/reference/concepts/builtin_functions/all.md new file mode 100644 index 00000000..bc96de8b --- /dev/null +++ b/reference/concepts/builtin_functions/all.md @@ -0,0 +1,7 @@ +# `all` + +TODO: ADD MORE DETAIL + +See [docs][docs]. + +[docs]: https://docs.python.org/3/library/functions.html#all diff --git a/reference/concepts/builtin_functions/any.md b/reference/concepts/builtin_functions/any.md new file mode 100644 index 00000000..6b3f2c34 --- /dev/null +++ b/reference/concepts/builtin_functions/any.md @@ -0,0 +1,7 @@ +# `any` + +TODO: ADD MORE DETAIL + +See [docs][docs]. + +[docs]: https://docs.python.org/3/library/functions.html#any diff --git a/reference/concepts/builtin_functions/ascii.md b/reference/concepts/builtin_functions/ascii.md new file mode 100644 index 00000000..f8cd58d9 --- /dev/null +++ b/reference/concepts/builtin_functions/ascii.md @@ -0,0 +1,7 @@ +# `ascii` + +TODO: ADD MORE DETAIL + +See [docs][docs]. + +[docs]: https://docs.python.org/3/library/functions.html#ascii diff --git a/reference/concepts/builtin_functions/bin.md b/reference/concepts/builtin_functions/bin.md new file mode 100644 index 00000000..c2c3289a --- /dev/null +++ b/reference/concepts/builtin_functions/bin.md @@ -0,0 +1,7 @@ +# `bin` + +TODO: ADD MORE DETAIL + +See [docs][docs]. + +[docs]: https://docs.python.org/3/library/functions.html#bin diff --git a/reference/concepts/builtin_functions/breakpoint.md b/reference/concepts/builtin_functions/breakpoint.md new file mode 100644 index 00000000..8fe28e92 --- /dev/null +++ b/reference/concepts/builtin_functions/breakpoint.md @@ -0,0 +1,7 @@ +# `breakpoint` + +TODO: ADD MORE DETAIL + +See [docs][docs]. + +[docs]: https://docs.python.org/3/library/functions.html#breakpoint diff --git a/reference/concepts/builtin_functions/callable.md b/reference/concepts/builtin_functions/callable.md new file mode 100644 index 00000000..f1b145bc --- /dev/null +++ b/reference/concepts/builtin_functions/callable.md @@ -0,0 +1,7 @@ +# `callable` + +TODO: ADD MORE DETAIL + +See [docs][docs]. + +[docs]: https://docs.python.org/3/library/functions.html#callable diff --git a/reference/concepts/builtin_functions/chr.md b/reference/concepts/builtin_functions/chr.md new file mode 100644 index 00000000..4f38ed39 --- /dev/null +++ b/reference/concepts/builtin_functions/chr.md @@ -0,0 +1,7 @@ +# `chr` + +TODO: ADD MORE DETAIL + +See [docs][docs]. + +[docs]: https://docs.python.org/3/library/functions.html#chr diff --git a/reference/concepts/builtin_functions/classmethod.md b/reference/concepts/builtin_functions/classmethod.md new file mode 100644 index 00000000..2826742c --- /dev/null +++ b/reference/concepts/builtin_functions/classmethod.md @@ -0,0 +1,7 @@ +# `classmethod` + +TODO: ADD MORE DETAIL + +See [docs][docs]. + +[docs]: https://docs.python.org/3/library/functions.html#classmethod diff --git a/reference/concepts/builtin_functions/compile.md b/reference/concepts/builtin_functions/compile.md new file mode 100644 index 00000000..fc5eaf31 --- /dev/null +++ b/reference/concepts/builtin_functions/compile.md @@ -0,0 +1,7 @@ +# `compile` + +TODO: ADD MORE DETAIL + +See [docs][docs]. + +[docs]: https://docs.python.org/3/library/functions.html#compile diff --git a/reference/concepts/builtin_functions/delattr.md b/reference/concepts/builtin_functions/delattr.md new file mode 100644 index 00000000..a0ac97b5 --- /dev/null +++ b/reference/concepts/builtin_functions/delattr.md @@ -0,0 +1,7 @@ +# `delattr` + +TODO: ADD MORE DETAIL + +See [docs][docs]. + +[docs]: https://docs.python.org/3/library/functions.html#delattr diff --git a/reference/concepts/builtin_functions/dir.md b/reference/concepts/builtin_functions/dir.md new file mode 100644 index 00000000..40d6d0d0 --- /dev/null +++ b/reference/concepts/builtin_functions/dir.md @@ -0,0 +1,7 @@ +# `dir` + +TODO: ADD MORE DETAIL + +See [docs][docs]. + +[docs]: https://docs.python.org/3/library/functions.html#dir diff --git a/reference/concepts/builtin_functions/divmod.md b/reference/concepts/builtin_functions/divmod.md new file mode 100644 index 00000000..ef7bf7a2 --- /dev/null +++ b/reference/concepts/builtin_functions/divmod.md @@ -0,0 +1,7 @@ +# `divmod` + +TODO: ADD MORE DETAIL + +See [docs][docs]. + +[docs]: https://docs.python.org/3/library/functions.html#divmod diff --git a/reference/concepts/builtin_functions/enumerate.md b/reference/concepts/builtin_functions/enumerate.md new file mode 100644 index 00000000..32950c8c --- /dev/null +++ b/reference/concepts/builtin_functions/enumerate.md @@ -0,0 +1,10 @@ +# `enumerate` + +The `enumerate` built-in function is a useful concept in the [variable-length-quantity][variable-length-quantity] exercise. + +TODO: ADD MORE DETAIL + +See [docs][docs]. + +[docs]: https://docs.python.org/3/library/functions.html#enumerate +[variable-length-quantity]: ../../exercise-concepts/variable-length-quantity.md diff --git a/reference/concepts/builtin_functions/eval.md b/reference/concepts/builtin_functions/eval.md new file mode 100644 index 00000000..e93921be --- /dev/null +++ b/reference/concepts/builtin_functions/eval.md @@ -0,0 +1,7 @@ +# `eval` + +TODO: ADD MORE DETAIL + +See [docs][docs]. + +[docs]: https://docs.python.org/3/library/functions.html#eval diff --git a/reference/concepts/builtin_functions/exec.md b/reference/concepts/builtin_functions/exec.md new file mode 100644 index 00000000..55aab0be --- /dev/null +++ b/reference/concepts/builtin_functions/exec.md @@ -0,0 +1,7 @@ +# `exec` + +TODO: ADD MORE DETAIL + +See [docs][docs]. + +[docs]: https://docs.python.org/3/library/functions.html#exec diff --git a/reference/concepts/builtin_functions/filter.md b/reference/concepts/builtin_functions/filter.md new file mode 100644 index 00000000..7053a041 --- /dev/null +++ b/reference/concepts/builtin_functions/filter.md @@ -0,0 +1,7 @@ +# `filter` + +TODO: ADD MORE DETAIL + +See [docs][docs]. + +[docs]: https://docs.python.org/3/library/functions.html#filter diff --git a/reference/concepts/builtin_functions/format.md b/reference/concepts/builtin_functions/format.md new file mode 100644 index 00000000..d32e5621 --- /dev/null +++ b/reference/concepts/builtin_functions/format.md @@ -0,0 +1,7 @@ +# `format` + +TODO: ADD MORE DETAIL + +See [docs][docs]. + +[docs]: https://docs.python.org/3/library/functions.html#format diff --git a/reference/concepts/builtin_functions/getattr.md b/reference/concepts/builtin_functions/getattr.md new file mode 100644 index 00000000..2ec5965a --- /dev/null +++ b/reference/concepts/builtin_functions/getattr.md @@ -0,0 +1,7 @@ +# `getattr` + +TODO: ADD MORE DETAIL + +See [docs][docs]. + +[docs]: https://docs.python.org/3/library/functions.html#getattr diff --git a/reference/concepts/builtin_functions/globals.md b/reference/concepts/builtin_functions/globals.md new file mode 100644 index 00000000..87daf0a7 --- /dev/null +++ b/reference/concepts/builtin_functions/globals.md @@ -0,0 +1,7 @@ +# `globals` + +TODO: ADD MORE DETAIL + +See [docs][docs]. + +[docs]: https://docs.python.org/3/library/functions.html#globals diff --git a/reference/concepts/builtin_functions/hasattr.md b/reference/concepts/builtin_functions/hasattr.md new file mode 100644 index 00000000..2899c442 --- /dev/null +++ b/reference/concepts/builtin_functions/hasattr.md @@ -0,0 +1,7 @@ +# `hasattr` + +TODO: ADD MORE DETAIL + +See [docs][docs]. + +[docs]: https://docs.python.org/3/library/functions.html#hasattr diff --git a/reference/concepts/builtin_functions/hash.md b/reference/concepts/builtin_functions/hash.md new file mode 100644 index 00000000..ee0be35e --- /dev/null +++ b/reference/concepts/builtin_functions/hash.md @@ -0,0 +1,7 @@ +# `hash` + +TODO: ADD MORE DETAIL + +See [docs][docs]. + +[docs]: https://docs.python.org/3/library/functions.html#hash diff --git a/reference/concepts/builtin_functions/help.md b/reference/concepts/builtin_functions/help.md new file mode 100644 index 00000000..94f61f37 --- /dev/null +++ b/reference/concepts/builtin_functions/help.md @@ -0,0 +1,7 @@ +# `help` + +TODO: ADD MORE DETAIL + +See [docs][docs]. + +[docs]: https://docs.python.org/3/library/functions.html#help diff --git a/reference/concepts/builtin_functions/hex.md b/reference/concepts/builtin_functions/hex.md new file mode 100644 index 00000000..d96698ac --- /dev/null +++ b/reference/concepts/builtin_functions/hex.md @@ -0,0 +1,7 @@ +# `hex` + +TODO: ADD MORE DETAIL + +See [docs][docs]. + +[docs]: https://docs.python.org/3/library/functions.html#hex diff --git a/reference/concepts/builtin_functions/id.md b/reference/concepts/builtin_functions/id.md new file mode 100644 index 00000000..1c8204d5 --- /dev/null +++ b/reference/concepts/builtin_functions/id.md @@ -0,0 +1,7 @@ +# `id` + +TODO: ADD MORE DETAIL + +See [docs][docs]. + +[docs]: https://docs.python.org/3/library/functions.html#id diff --git a/reference/concepts/builtin_functions/input.md b/reference/concepts/builtin_functions/input.md new file mode 100644 index 00000000..ead5e447 --- /dev/null +++ b/reference/concepts/builtin_functions/input.md @@ -0,0 +1,7 @@ +# `input` + +TODO: ADD MORE DETAIL + +See [docs][docs]. + +[docs]: https://docs.python.org/3/library/functions.html#input diff --git a/reference/concepts/builtin_functions/isinstance.md b/reference/concepts/builtin_functions/isinstance.md new file mode 100644 index 00000000..af5a449e --- /dev/null +++ b/reference/concepts/builtin_functions/isinstance.md @@ -0,0 +1,7 @@ +# `isinstance` + +TODO: ADD MORE DETAIL + +See [docs][docs]. + +[docs]: https://docs.python.org/3/library/functions.html#isinstance diff --git a/reference/concepts/builtin_functions/issubclass.md b/reference/concepts/builtin_functions/issubclass.md new file mode 100644 index 00000000..1b27baf5 --- /dev/null +++ b/reference/concepts/builtin_functions/issubclass.md @@ -0,0 +1,7 @@ +# `issubclass` + +TODO: ADD MORE DETAIL + +See [docs][docs]. + +[docs]: https://docs.python.org/3/library/functions.html#issubclass diff --git a/reference/concepts/builtin_functions/iter.md b/reference/concepts/builtin_functions/iter.md new file mode 100644 index 00000000..c59de78f --- /dev/null +++ b/reference/concepts/builtin_functions/iter.md @@ -0,0 +1,7 @@ +# `iter` + +TODO: ADD MORE DETAIL + +See [docs][docs]. + +[docs]: https://docs.python.org/3/library/functions.html#iter diff --git a/reference/concepts/builtin_functions/len.md b/reference/concepts/builtin_functions/len.md new file mode 100644 index 00000000..39984a0d --- /dev/null +++ b/reference/concepts/builtin_functions/len.md @@ -0,0 +1,12 @@ +# `len` + +The `len` built-in function is a useful concept to solve the [hamming][hamming] and [variable-length-quantity][variable-length-quantity.md] exercises. + +TODO: ADD MORE DETAIL + +See [docs][docs]. + +[docs]: https://docs.python.org/3/library/functions.html#len +[hamming]: ../../exercise-concepts/hamming.md +[variable-length-quantity]: ../../exercise-concepts/variable-length-quantity.md + diff --git a/reference/concepts/builtin_functions/locals.md b/reference/concepts/builtin_functions/locals.md new file mode 100644 index 00000000..74d07f65 --- /dev/null +++ b/reference/concepts/builtin_functions/locals.md @@ -0,0 +1,7 @@ +# `locals` + +TODO: ADD MORE DETAIL + +See [docs][docs]. + +[docs]: https://docs.python.org/3/library/functions.html#locals diff --git a/reference/concepts/builtin_functions/map.md b/reference/concepts/builtin_functions/map.md new file mode 100644 index 00000000..a1263c95 --- /dev/null +++ b/reference/concepts/builtin_functions/map.md @@ -0,0 +1,7 @@ +# `map` + +TODO: ADD MORE DETAIL + +See [docs][docs]. + +[docs]: https://docs.python.org/3/library/functions.html#map diff --git a/reference/concepts/builtin_functions/max.md b/reference/concepts/builtin_functions/max.md new file mode 100644 index 00000000..21c33b71 --- /dev/null +++ b/reference/concepts/builtin_functions/max.md @@ -0,0 +1,10 @@ +# `max` + +The `max` built-in function is a useful concept to solve the [hamming][hamming] exercise. + +TODO: ADD MORE DETAIL + +See [docs][docs]. + +[docs]: https://docs.python.org/3/library/functions.html#max +[hamming]: ../../exercise-concepts/hamming.md diff --git a/reference/concepts/builtin_functions/min.md b/reference/concepts/builtin_functions/min.md new file mode 100644 index 00000000..78ae6248 --- /dev/null +++ b/reference/concepts/builtin_functions/min.md @@ -0,0 +1,10 @@ +# `min` + +The `min` built-in function is a useful concept to solve the [hamming][hamming] exercise. + +TODO: ADD MORE DETAIL + +See [docs][docs]. + +[docs]: https://docs.python.org/3/library/functions.html#min +[hamming]: ../../exercise-concepts/hamming.md diff --git a/reference/concepts/builtin_functions/next.md b/reference/concepts/builtin_functions/next.md new file mode 100644 index 00000000..540fbc81 --- /dev/null +++ b/reference/concepts/builtin_functions/next.md @@ -0,0 +1,7 @@ +# `next` + +TODO: ADD MORE DETAIL + +See [docs][docs]. + +[docs]: https://docs.python.org/3/library/functions.html#next diff --git a/reference/concepts/builtin_functions/oct.md b/reference/concepts/builtin_functions/oct.md new file mode 100644 index 00000000..2aef5979 --- /dev/null +++ b/reference/concepts/builtin_functions/oct.md @@ -0,0 +1,7 @@ +# `oct` + +TODO: ADD MORE DETAIL + +See [docs][docs]. + +[docs]: https://docs.python.org/3/library/functions.html#oct diff --git a/reference/concepts/builtin_functions/open.md b/reference/concepts/builtin_functions/open.md new file mode 100644 index 00000000..e8b9708f --- /dev/null +++ b/reference/concepts/builtin_functions/open.md @@ -0,0 +1,7 @@ +# `open` + +TODO: ADD MORE DETAIL + +See [docs][docs]. + +[docs]: https://docs.python.org/3/library/functions.html#open diff --git a/reference/concepts/builtin_functions/ord.md b/reference/concepts/builtin_functions/ord.md new file mode 100644 index 00000000..0f9929ea --- /dev/null +++ b/reference/concepts/builtin_functions/ord.md @@ -0,0 +1,7 @@ +# `ord` + +TODO: ADD MORE DETAIL + +See [docs][docs]. + +[docs]: https://docs.python.org/3/library/functions.html#ord diff --git a/reference/concepts/builtin_functions/pow.md b/reference/concepts/builtin_functions/pow.md new file mode 100644 index 00000000..5f0d5686 --- /dev/null +++ b/reference/concepts/builtin_functions/pow.md @@ -0,0 +1,7 @@ +# `pow` + +TODO: ADD MORE DETAIL + +See [docs][docs]. + +[docs]: https://docs.python.org/3/library/functions.html#pow diff --git a/reference/concepts/builtin_functions/print.md b/reference/concepts/builtin_functions/print.md new file mode 100644 index 00000000..52ee90b7 --- /dev/null +++ b/reference/concepts/builtin_functions/print.md @@ -0,0 +1,7 @@ +# `print` + +TODO: ADD MORE DETAIL + +See [docs][docs]. + +[docs]: https://docs.python.org/3/library/functions.html#print diff --git a/reference/concepts/builtin_functions/repr.md b/reference/concepts/builtin_functions/repr.md new file mode 100644 index 00000000..914b77e8 --- /dev/null +++ b/reference/concepts/builtin_functions/repr.md @@ -0,0 +1,7 @@ +# `repr` + +TODO: ADD MORE DETAIL + +See [docs][docs]. + +[docs]: https://docs.python.org/3/library/functions.html#repr diff --git a/reference/concepts/builtin_functions/reversed.md b/reference/concepts/builtin_functions/reversed.md new file mode 100644 index 00000000..37993623 --- /dev/null +++ b/reference/concepts/builtin_functions/reversed.md @@ -0,0 +1,7 @@ +# `reversed` + +TODO: ADD MORE DETAIL + +See [docs][docs]. + +[docs]: https://docs.python.org/3/library/functions.html#reversed diff --git a/reference/concepts/builtin_functions/round.md b/reference/concepts/builtin_functions/round.md new file mode 100644 index 00000000..2f021359 --- /dev/null +++ b/reference/concepts/builtin_functions/round.md @@ -0,0 +1,7 @@ +# `round` + +TODO: ADD MORE DETAIL + +See [docs][docs]. + +[docs]: https://docs.python.org/3/library/functions.html#round diff --git a/reference/concepts/builtin_functions/setattr.md b/reference/concepts/builtin_functions/setattr.md new file mode 100644 index 00000000..05d89774 --- /dev/null +++ b/reference/concepts/builtin_functions/setattr.md @@ -0,0 +1,7 @@ +# `setattr` + +TODO: ADD MORE DETAIL + +See [docs][docs]. + +[docs]: https://docs.python.org/3/library/functions.html#setattr diff --git a/reference/concepts/builtin_functions/sorted.md b/reference/concepts/builtin_functions/sorted.md new file mode 100644 index 00000000..abd025dd --- /dev/null +++ b/reference/concepts/builtin_functions/sorted.md @@ -0,0 +1,7 @@ +# `sorted` + +TODO: ADD MORE DETAIL + +See [docs][docs]. + +[docs]: https://docs.python.org/3/library/functions.html#sorted diff --git a/reference/concepts/builtin_functions/staticmethod.md b/reference/concepts/builtin_functions/staticmethod.md new file mode 100644 index 00000000..1c8bc679 --- /dev/null +++ b/reference/concepts/builtin_functions/staticmethod.md @@ -0,0 +1,7 @@ +# `staticmethod` + +TODO: ADD MORE DETAIL + +See [docs][docs]. + +[docs]: https://docs.python.org/3/library/functions.html#staticmethod diff --git a/reference/concepts/builtin_functions/sum.md b/reference/concepts/builtin_functions/sum.md new file mode 100644 index 00000000..fc2b79c9 --- /dev/null +++ b/reference/concepts/builtin_functions/sum.md @@ -0,0 +1,10 @@ +# `sum` + +The `sum` built-in function is a useful concept to solve the [variable-length-quantity][variable-length-quantity] exercise. + +TODO: ADD MORE DETAIL + +See [docs][docs]. + +[docs]: https://docs.python.org/3/library/functions.html#sum +[variable-length-quantity]: ../../exercise-concepts/variable-length-quantity.md diff --git a/reference/concepts/builtin_functions/super.md b/reference/concepts/builtin_functions/super.md new file mode 100644 index 00000000..94a8ec18 --- /dev/null +++ b/reference/concepts/builtin_functions/super.md @@ -0,0 +1,7 @@ +# `super` + +TODO: ADD MORE DETAIL + +See [docs][docs]. + +[docs]: https://docs.python.org/3/library/functions.html#super diff --git a/reference/concepts/builtin_functions/vars.md b/reference/concepts/builtin_functions/vars.md new file mode 100644 index 00000000..7a9a4bbe --- /dev/null +++ b/reference/concepts/builtin_functions/vars.md @@ -0,0 +1,7 @@ +# `vars` + +TODO: ADD MORE DETAIL + +See [docs][docs]. + +[docs]: https://docs.python.org/3/library/functions.html#vars diff --git a/reference/concepts/builtin_functions/zip.md b/reference/concepts/builtin_functions/zip.md new file mode 100644 index 00000000..f030aa1b --- /dev/null +++ b/reference/concepts/builtin_functions/zip.md @@ -0,0 +1,12 @@ +# `zip` + +Joins multiple iterables into a single one. The `zip` built-in function is a useful concept to solve the [hamming][hamming] and [matrix][matrix] exercises. + +TODO: ADD MORE DETAIL + +See [docs][docs]. + +[docs]: https://docs.python.org/3/library/functions.html#zip +[hamming]: ../../exercise-concepts/hamming.md +[matrix]: ../../exercise-concepts/matrix.md + diff --git a/reference/concepts/builtin_types/bool.md b/reference/concepts/builtin_types/bool.md new file mode 100644 index 00000000..171aa380 --- /dev/null +++ b/reference/concepts/builtin_types/bool.md @@ -0,0 +1,10 @@ +# `bool` + +TODO: ADD MORE DETAIL + +See the Python documentation entries on [casting using `bool`][docs-bool-as-function], the [Boolean values][docs-boolean-values], Python's notion of ["truth"][docs-truth], and the use of Boolean values as a [numeric type][docs-bool-as-numeric]. + +[docs-bool-as-function]: https://docs.python.org/3/library/functions.html#bool +[docs-boolean-values]: https://docs.python.org/3/library/stdtypes.html#bltin-boolean-values +[docs-truth]: https://docs.python.org/3/library/stdtypes.html#truth +[docs-bool-as-numeric]: https://docs.python.org/3/library/stdtypes.html#typesnumeric diff --git a/reference/concepts/builtin_types/bytearray.md b/reference/concepts/builtin_types/bytearray.md new file mode 100644 index 00000000..ea1d5b5d --- /dev/null +++ b/reference/concepts/builtin_types/bytearray.md @@ -0,0 +1,13 @@ +# `bytearray` + +TODO: ADD MORE DETAIL + +See the Python documentation entries for the [binary sequence types][docs-binary-sequence-types], of which [`bytearray`][docs-bytearray-type] is the [mutable][mutation] member. You'll also want to familiarize yourself with the use of [`bytearray` as a casting function][docs-bytearray-as-function], as well as the many [common binary sequence methods][docs-binary-sequence-methods] and [mutable sequence methods][docs-mutable-sequence-methods] available to use on the type. + +[mutation]: ../../../../../reference/concepts/mutation.md + +[docs-binary-sequence-types]: https://docs.python.org/3/library/stdtypes.html#binaryseq +[docs-bytearray-type]: https://docs.python.org/3/library/stdtypes.html#typebytearray +[docs-bytearray-as-function]: https://docs.python.org/3/library/stdtypes.html#bytearray +[docs-binary-sequence-methods]: https://docs.python.org/3/library/stdtypes.html#bytes-methods +[docs-mutable-sequence-methods]: https://docs.python.org/3/library/stdtypes.html#typesseq-mutable diff --git a/reference/concepts/builtin_types/bytes.md b/reference/concepts/builtin_types/bytes.md new file mode 100644 index 00000000..e91608db --- /dev/null +++ b/reference/concepts/builtin_types/bytes.md @@ -0,0 +1,11 @@ +# `bytes` + +TODO: ADD MORE DETAIL + +See the Python documentation entries for the [binary sequence types][docs-binary-sequence-types], of which [`bytes`][docs-bytes-type] is the [immutable][immutability] member. You'll also want to familiarize yourself with the use of [`bytes` as a casting function][docs-bytes-as-function], as well as the many [common binary sequence methods][docs-binary-sequence-methods] available to use on the type. + +[immutable]: ../../../../../reference/concepts/immutability.md +[docs-binary-sequence-types]: https://docs.python.org/3/library/stdtypes.html#binaryseq +[docs-bytes-type]: https://docs.python.org/3/library/stdtypes.html#typebytes +[docs-bytes-as-function]: https://docs.python.org/3/library/stdtypes.html#bytes +[docs-binary-sequence-methods]: https://docs.python.org/3/library/stdtypes.html#bytes-methods diff --git a/reference/concepts/builtin_types/complex.md b/reference/concepts/builtin_types/complex.md new file mode 100644 index 00000000..1fc5cf3a --- /dev/null +++ b/reference/concepts/builtin_types/complex.md @@ -0,0 +1,8 @@ +# `complex` + +TODO: ADD MORE DETAIL + +See the Python documentation entries on the [complex number type][docs-complex-type], one of several [numerical types][docs-numerical-types]. + +[docs-complex-type]: https://docs.python.org/3/library/functions.html#complex +[docs-numerical-types]: https://docs.python.org/3/library/stdtypes.html#typesnumeric diff --git a/reference/concepts/builtin_types/dict.md b/reference/concepts/builtin_types/dict.md new file mode 100644 index 00000000..5cfab099 --- /dev/null +++ b/reference/concepts/builtin_types/dict.md @@ -0,0 +1,16 @@ +# `dict` + +Python's primary [mapping type][docs-mapping-type] that associatess keys with values in a [hash map][hash-map]. + +See examples of usage in [markdown][markdown], [rna-transcription][rna-transcription], and [robot-simulator][robot-simulator]. + +TODO: ADD MORE DETAIL + +See the Python documentation entries for [`dict`][docs-dict-type], the primary [mapping type][docs-mapping-type]; specifically a [hash map][hash-map]. + +[markdown]: ../../exercise-concepts/markdown.md +[rna-transcription]: ../../exercise-concepts/rna-transcription.md +[robot-simulator]: ../../exercise-concepts/robot-simulator.md +[hash-map]: ../../../../../reference/types/hash_map.md +[docs-dict-type]: https://docs.python.org/3/library/stdtypes.html#dict +[docs-mapping-type]: https://docs.python.org/3/library/stdtypes.html#typesmapping diff --git a/reference/concepts/builtin_types/float.md b/reference/concepts/builtin_types/float.md new file mode 100644 index 00000000..0ce7b4dd --- /dev/null +++ b/reference/concepts/builtin_types/float.md @@ -0,0 +1,11 @@ +# `float` + +TODO: ADD MORE DETAIL + +See the Python documentation entries on the [floating point number type][docs-complex-type], one of several [numerical types][docs-numerical-types]. In particular note that you can cast to a valid float from any [numeric token string][docs-numeric-token], as well as special tokens for [NaN][docs-nan-token] and [+/- Infinity][docs-infinity-token]. + +[docs-float-type]: https://docs.python.org/3/library/functions.html#float +[docs-numerical-types]: https://docs.python.org/3/library/stdtypes.html#typesnumeric +[docs-infinity-token]: https://docs.python.org/3/library/functions.html#grammar-token-infinity +[docs-nan-token]: https://docs.python.org/3/library/functions.html#grammar-token-nan +[docs-numeric-token]: https://docs.python.org/3/library/functions.html#grammar-token-numeric-value diff --git a/reference/concepts/builtin_types/frozenset.md b/reference/concepts/builtin_types/frozenset.md new file mode 100644 index 00000000..391958b2 --- /dev/null +++ b/reference/concepts/builtin_types/frozenset.md @@ -0,0 +1,11 @@ +# `frozenset` + +TODO: ADD MORE DETAIL + +See the Python documentation entries for the [`set`][docs-set] collection, the [immutable] [set type][docs-set-type]; essentially a [hash map][hash-map] in which only the key is relevant, and which disallows [mutaion][mutation] of keys after intialization. + +[immutable]: ../../../../../reference/concepts/immutability.md +[mutation]: ../../../../../reference/concepts/mutation.md +[hash-map]: ../../../../../reference/types/hash_map.md +[docs-frozenset]: https://docs.python.org/3/library/stdtypes.html#frozenset +[docs-frozenset-type]: https://docs.python.org/3/library/stdtypes.html#types-set diff --git a/reference/concepts/builtin_types/int.md b/reference/concepts/builtin_types/int.md new file mode 100644 index 00000000..845a8a9f --- /dev/null +++ b/reference/concepts/builtin_types/int.md @@ -0,0 +1,13 @@ +# `int` + +Python's fundamental integral primitive; it is signed, and is of arbitrary precision (all `int` values are what other languages might call a "BigInt" or "Long"). When used as a function `int()` can convert appropriately formatted strings to `int` values. + +See [matrix][matrix] for an example of this type-casting behavior. + +TODO: ADD MORE DETAIL + +See the Python documentation entries on the [integral number type][docs-int-type], one of several [numerical types][docs-numerical-types]. + +[matrix]: ../../exercise-concepts/matrix.md +[docs-int-type]: https://docs.python.org/3/library/functions.html#int +[docs-numerical-types]: https://docs.python.org/3/library/stdtypes.html#typesnumeric diff --git a/reference/concepts/builtin_types/list.md b/reference/concepts/builtin_types/list.md new file mode 100644 index 00000000..fafb61d2 --- /dev/null +++ b/reference/concepts/builtin_types/list.md @@ -0,0 +1,22 @@ +# `list` + +Lists are dynamic arrays that can be resized by Python at runtime. They are homogenous, meaning they are able to hold any data type, including other lists, and can even contain themselves (recursive data structures are relatively simple in Python). + +Simple flat lists are used extensively in [variable-length-quantity][variable-length-quantity], [markdown][markdown], and [robot-simulator][robot-simulator]. + +A multi-dimensional list-with-a-list is used as a simple (but not very efficient) matrix type in [matrix][matrix]. + +TODO: ADD MORE DETAIL + +See the Python documentation entries for the [mutable][mutation] [`list` type][docs-list-type] and it's [constructor][list-as-function]. This is Python's most commonly used [sequential collection][docs-sequence-types], and as it allows _heterogenous data_ it's quite different from the [fixed array][general-concept-array] and [singly-linked list][general-concept-list] types you may have encountered in other, less flexible, languages. + +[variable-length-quantity]: ../../exercise-concepts/variable-length-quantity.md +[markdown]: ../../exercise-concepts/markdown.md +[robot-simulator]: ../../exercise-concepts/robot-simulator.md +[matrix]: ../../exercise-concepts/matrix.md +[mutation]: ../../../../../reference/concepts/mutation.md +[general-concept-array]: ../../../../../reference/types/array.md +[general-concept-list]: ../../../../../reference/types/list.md +[docs-list-type]: https://docs.python.org/3/library/stdtypes.html#typesseq-list +[docs-list-as-function]: https://docs.python.org/3/library/stdtypes.html#list +[docs-sequence-types]: https://docs.python.org/3/library/stdtypes.html#typesseq diff --git a/reference/concepts/builtin_types/memoryview.md b/reference/concepts/builtin_types/memoryview.md new file mode 100644 index 00000000..bdb6c89e --- /dev/null +++ b/reference/concepts/builtin_types/memoryview.md @@ -0,0 +1,7 @@ +# `memoryview` + +TODO: ADD MORE DETAIL + +See the Python documentation entry for the [`memoryview`][docs-memoryview-type] type. + +[docs-memoryview-type]: https://docs.python.org/3/library/stdtypes.html#typememoryview diff --git a/reference/concepts/builtin_types/object.md b/reference/concepts/builtin_types/object.md new file mode 100644 index 00000000..785cc85a --- /dev/null +++ b/reference/concepts/builtin_types/object.md @@ -0,0 +1,6 @@ +# `object` + +Both the root [type of all Python objects][docs-everything-is-an-object] and a [function that returns a featureless object][docs-object-as-function]. Rarely used directly, but useful when you need a _sentinel_ value in a collection that might legitimately contain [`None`][none]. + +[docs-everything-is-an-object]: https://docs.python.org/3/reference/datamodel.html +[docs-object-as-function]: https://docs.python.org/3/library/functions.html#object diff --git a/reference/concepts/builtin_types/property.md b/reference/concepts/builtin_types/property.md new file mode 100644 index 00000000..067cee47 --- /dev/null +++ b/reference/concepts/builtin_types/property.md @@ -0,0 +1,7 @@ +# `property` + +Usually encountered as a [decorator][decorators] that controls read / write access to a [class attribute][class-attributes], but actually implemented as a specialized class all its own. See the [docs][docs-property-as-function] for details. + +[decorators]: ../decorators.md +[class-attributes]: ../class_attributes.md +[docs-property-as-function]: https://docs.python.org/3/library/functions.html#property diff --git a/reference/concepts/builtin_types/range.md b/reference/concepts/builtin_types/range.md new file mode 100644 index 00000000..2f23577e --- /dev/null +++ b/reference/concepts/builtin_types/range.md @@ -0,0 +1,15 @@ +# `range` + +The `range()` built-in represents an immutable sequence of numbers (or any object that implements the __index__ dunder method). Used in the [markdown][markdown] to control the number of loops while iterating through a passed-in line or list. Used in [robot-simulator][robot-simulator] to represent the values from zero to 3 as assigned to NORTH, EAST, SOUTH, WEST. + +TODO: ADD MORE DETAIL + +See the Python documentation entries for the [immutable][immutable] [`range` type][docs-range-type] and its [constructor][range-as-function]. This is Python's most commonly used tool for efficiently working with a [sequential collection][docs-sequence-types] of [`int`][int] values. + +[immutable]: ../../../../../reference/concepts/immutability.md +[docs-range-type]: https://docs.python.org/3/library/stdtypes.html#typesseq-range +[docs-range-as-function]: https://docs.python.org/3/library/stdtypes.html#range +[docs-sequence-types]: https://docs.python.org/3/library/stdtypes.html#typesseq + +[markdown]: ../../exercise-concepts/markdown.md +[robot-simulator]: ../../exercise-concepts/robot-simulator.md diff --git a/reference/concepts/builtin_types/set.md b/reference/concepts/builtin_types/set.md new file mode 100644 index 00000000..19686ecb --- /dev/null +++ b/reference/concepts/builtin_types/set.md @@ -0,0 +1,10 @@ +# `set` + +TODO: ADD MORE DETAIL + +See the Python documentation entries for the [`set`][docs-set] collection, which is the [mutable][mutation] [set type][docs-set-type]; essentially a [hash map][hash-map] in which only the key is relevant. + +[mutation]: ../../../../../reference/concepts/mutation.md +[hash-map]: ../../../../../reference/types/hash_map.md +[docs-set]: https://docs.python.org/3/library/stdtypes.html#set +[docs-set-type]: https://docs.python.org/3/library/stdtypes.html#types-set diff --git a/reference/concepts/builtin_types/slice.md b/reference/concepts/builtin_types/slice.md new file mode 100644 index 00000000..2d87ce99 --- /dev/null +++ b/reference/concepts/builtin_types/slice.md @@ -0,0 +1,8 @@ +# `slice` + +An internal type you usually won't notice directly, but under the hood it's used whenever you use [slicing][slicing] syntax. + +See the Python documentation entry for the [`slice`][docs-slice] function. + +[slicing]: ../slicing.md +[docs-slice]: https://docs.python.org/3/library/functions.html#slice diff --git a/reference/concepts/builtin_types/str.md b/reference/concepts/builtin_types/str.md new file mode 100644 index 00000000..1d7bed7c --- /dev/null +++ b/reference/concepts/builtin_types/str.md @@ -0,0 +1,17 @@ +# `str` + +Python's [string][general-concept-string] type, which always holds encoded [Unicode][unicode] text. + +A useful concept to know to solve the [hamming][hamming] exercise. + + TODO: ADD MORE DETAIL + +See the Python documentation entries for the [immutable][immutability] [text sequence type][docs-text-sequence-type]. You'll also want to familiarize yourself with the use of [`str` as a casting function][docs-str-as-function], as well as the many [string methods][docs-string-methods] available to use on the type. + +[hamming]: ../../exercise-concepts/hamming.md +[general-concept-string]: ../../../../../reference/types/string.md +[unicode]: ../../../../../reference/concepts/unicode.md +[immutable]: ../../../../../reference/concepts/immutability.md +[docs-text-sequence-type]: https://docs.python.org/3/library/stdtypes.html#textseq +[docs-str-as-function]: https://docs.python.org/3/library/stdtypes.html#str +[docs-string-methods]: https://docs.python.org/3/library/stdtypes.html#string-methods diff --git a/reference/concepts/builtin_types/tuple.md b/reference/concepts/builtin_types/tuple.md new file mode 100644 index 00000000..92073d82 --- /dev/null +++ b/reference/concepts/builtin_types/tuple.md @@ -0,0 +1,10 @@ +# `tuple` + +TODO: ADD MORE DETAIL + +See the Python documentation entries for the [immutable][immutability] [`tuple` type][docs-tuple-type] and its [constructor][tuple-as-function]. One of Python's [sequential collection types][docs-sequence-types], it is fixed in size, but allows _homogenous data_. Because it cannot be resized it is less flexible than a [`list`][list], but has the advantage of taking up very little room in memory, compared to any other collection. + +[immutability]: ../../../../../reference/concepts/immutability.md +[docs-tuple-as-function]: https://docs.python.org/3/library/stdtypes.html#tuple +[docs-tuple-type]: https://docs.python.org/3/library/stdtypes.html#typesseq-tuple +[docs-sequence-types]: https://docs.python.org/3/library/stdtypes.html#typesseq diff --git a/reference/concepts/builtin_types/type.md b/reference/concepts/builtin_types/type.md new file mode 100644 index 00000000..7da56638 --- /dev/null +++ b/reference/concepts/builtin_types/type.md @@ -0,0 +1,8 @@ +# `type` + +TODO: ADD MORE DETAIL + +Both the root [metaclass of all builtin objects][docs-type-as-metaclass] and a [function that returns the type of a given object][docs-type-as-function]. + +[docs-type-as-function]: https://docs.python.org/3/library/functions.html#type +[docs-type-as-metaclass]: https://docs.python.org/3/library/stdtypes.html#bltin-type-objects diff --git a/reference/concepts/call_semantics.md b/reference/concepts/call_semantics.md new file mode 100644 index 00000000..0ac78de2 --- /dev/null +++ b/reference/concepts/call_semantics.md @@ -0,0 +1,5 @@ +# Call semantics + +TODO: ADD MORE + +- knowing that appending `()` to the name of an instance method _calls_ it, since instance methods are _callable_. [robot-simulator](../exercise-concepts/robot-simulator.md) diff --git a/reference/concepts/class_attributes.md b/reference/concepts/class_attributes.md new file mode 100644 index 00000000..7536e956 --- /dev/null +++ b/reference/concepts/class_attributes.md @@ -0,0 +1,3 @@ +# Class attributes + +TODO: ADD MORE diff --git a/reference/concepts/class_composition.md b/reference/concepts/class_composition.md new file mode 100644 index 00000000..62cd8bc9 --- /dev/null +++ b/reference/concepts/class_composition.md @@ -0,0 +1,5 @@ +# Class composition (vs inheritance) + +TODO: ADD MORE + +- adding functionality from a class by incorporating an instance of that class in a class you are creating. The example creates a `robot` by instantiating a `compass` and assigning it to the `self`.compass attribute of `robot`. [robot-simulator](../exercise-concepts/robot-simulator.md) diff --git a/reference/concepts/class_inheritance.md b/reference/concepts/class_inheritance.md new file mode 100644 index 00000000..d133e0ad --- /dev/null +++ b/reference/concepts/class_inheritance.md @@ -0,0 +1,7 @@ +# Class inheritance + +TODO: ADD MORE + +- The default `__str___` method is inherited from `Object`, which every class in Python inherits from. (See: inheritance) [phone-number](../exercise-concepts/phone-number.md) +- a "subclass" will inherit all methods, attributes from it's parent class, and can then override methods as needed. Overriding means the logic in the parent class is not used. The `super` builtin function (not shown here) exists to allow the programmer to defer logic up the inheritance chain to the parent class when needed. [phone-number](../exercise-concepts/phone-number.md) +- the knowledge of inheritance can be useful in this exercises because all `Exceptions` types inherit from the base class [variable-length-quantity](../exercise-concepts/variable-length-quantity.md) diff --git a/reference/concepts/class_members.md b/reference/concepts/class_members.md new file mode 100644 index 00000000..bc2d6fa2 --- /dev/null +++ b/reference/concepts/class_members.md @@ -0,0 +1,5 @@ +# Class members + +TODO: ADD MORE + +- student must know how members of a class work [binary-search-tree](../exercise-concepts/binary-search-tree.md) diff --git a/reference/concepts/class_methods.md b/reference/concepts/class_methods.md new file mode 100644 index 00000000..65fff007 --- /dev/null +++ b/reference/concepts/class_methods.md @@ -0,0 +1,5 @@ +# Class methods + +TODO: ADD MORE + +- student must know how methods of a class work inside and outside the class, the use and meaning of `def` statement [binary-search-tree](../exercise-concepts/binary-search-tree.md) diff --git a/reference/concepts/comparison_operators.md b/reference/concepts/comparison_operators.md new file mode 100644 index 00000000..a36960be --- /dev/null +++ b/reference/concepts/comparison_operators.md @@ -0,0 +1,6 @@ +# Comparison operators + +TODO: ADD MORE + +- concept required to solve the exercise, `==`, `>`, `<` [variable-length-quantity](../exercise-concepts/variable-length-quantity.md) +- the exercise relies on the `==` and `!=` operators to make binary comparisons between values [leap](../exercise-concepts/leap.md) diff --git a/reference/concepts/comprehension_syntax.md b/reference/concepts/comprehension_syntax.md new file mode 100644 index 00000000..bf70d538 --- /dev/null +++ b/reference/concepts/comprehension_syntax.md @@ -0,0 +1,6 @@ +# Comprehension syntax + +TODO: ADD MORE + +- knowing that this is equivalent to a `for loop` - putting the row or column creation code _inside_ the list literal instead of using loop + append. [matrix](../exercise-concepts/matrix.md) +- the use of list comprehension concept can be useful in this exercise [variable-length-quantity](../exercise-concepts/variable-length-quantity.md) diff --git a/reference/concepts/conditional_structures.md b/reference/concepts/conditional_structures.md new file mode 100644 index 00000000..aab8fd18 --- /dev/null +++ b/reference/concepts/conditional_structures.md @@ -0,0 +1,6 @@ +# Conditionals + +TODO: ADD MORE + +- The example solution uses `if` to check for pattern matching and membership conditions in different functions for processing different markdown patterns. [markdown](../exercise-concepts/markdown.md) +- `if ... else` and `elif` allow a programmer to switch code branches depending on some condition [phone-number](../exercise-concepts/phone-number.md) diff --git a/reference/concepts/constants.md b/reference/concepts/constants.md new file mode 100644 index 00000000..9fb1da99 --- /dev/null +++ b/reference/concepts/constants.md @@ -0,0 +1,6 @@ +# Constants + +TODO: ADD MORE + +- Avoid "magic numbers", defining instead meaningfully named constants. PEP 8 convention for constants: `UPPER_SNAKE_CASE` [clock](../exercise-concepts/clock.md) +- are not enforced by the runtime, but are used via the convention of `UPPER_CASE` to signal that these values are expected to remain unchanged. Preferably, constants are defined at a module level. The example solution uses the `UPPER_CASE` convention to define NORTH, SOUTH, EAST, and WEST constants. [robot-simulator](../exercise-concepts/robot-simulator.md) diff --git a/reference/concepts/constructor.md b/reference/concepts/constructor.md new file mode 100644 index 00000000..292e436f --- /dev/null +++ b/reference/concepts/constructor.md @@ -0,0 +1,6 @@ +# Constructor + +TODO: ADD MORE + +- student needs to know how to build an object using its constructor [binary-search-tree](../exercise-concepts/binary-search-tree.md) +- customizing object initalization with actions and persisting data. The example uses a constructor to process the passed in data into a list of lists assigned to an instance property [matrix](../exercise-concepts/matrix.md) diff --git a/reference/concepts/custom_classes.md b/reference/concepts/custom_classes.md new file mode 100644 index 00000000..5f921201 --- /dev/null +++ b/reference/concepts/custom_classes.md @@ -0,0 +1,10 @@ +# Classes + +TODO: ADD MORE + +- the exercise relies on the `class` statement to create a custom class [allergies](../exercise-concepts/allergies.md) +- use of `class` to create a custom data structure [clock](../exercise-concepts/clock.md) +- the exercise objective is to define a `matrix` type. Tested methods are linked to a `matrix` class [matrix](../exercise-concepts/matrix.md) +- a general comprehension of class concept and and how it works is required, `class` statement [binary-search-tree](../exercise-concepts/binary-search-tree.md) +- classes are defined with the `class :` syntax [phone-number](../exercise-concepts/phone-number.md) +- the exercise objective is to define a `robot` type. Tested methods are linked to a `robot` class. [robot-simulator](../exercise-concepts/robot-simulator.md) diff --git a/reference/concepts/data_structures.md b/reference/concepts/data_structures.md new file mode 100644 index 00000000..a665f3db --- /dev/null +++ b/reference/concepts/data_structures.md @@ -0,0 +1,5 @@ +# Data structures + +TODO: ADD MORE + +- the exercise requires the use of a collection like enum.Flag or collections.OrderedDict [allergies](../exercise-concepts/allergies.md) diff --git a/reference/concepts/decorators.md b/reference/concepts/decorators.md new file mode 100644 index 00000000..bbdefefc --- /dev/null +++ b/reference/concepts/decorators.md @@ -0,0 +1,5 @@ +# Decorators + +TODO: ADD MORE + +- a higher-order function that takes another function as an argument. The "decorating" function extends the behavior of the "decorated" function without explicitly modifying it (i.e. it _wraps_ or _decorates_ it). Called in python by using the `@` symbol and the function name ahead of the function being decorated. The example uses pythons built-in `property()` as a decorator (`@property`) to return a "compound" read-only instance property made up of two separate instance attributes. [robot-simulator](../exercise-concepts/robot-simulator.md) diff --git a/reference/concepts/decorators_as_higher_order_functions.md b/reference/concepts/decorators_as_higher_order_functions.md new file mode 100644 index 00000000..32296c13 --- /dev/null +++ b/reference/concepts/decorators_as_higher_order_functions.md @@ -0,0 +1,5 @@ +# Decorators as higher-order functions + +TODO: ADD MORE + +- a function that takes one or more other functions as arguments, _returning_ a function as its return value. The example uses the built-in `property()` as a higher-order function through `@property`. [robot-simulator](../exercise-concepts/robot-simulator.md) diff --git a/reference/concepts/default_arguments.md b/reference/concepts/default_arguments.md new file mode 100644 index 00000000..987eaee8 --- /dev/null +++ b/reference/concepts/default_arguments.md @@ -0,0 +1,5 @@ +# Default arguments + +TODO: ADD MORE + +- pre-setting function arguments to protect against them not being passed by a caller. The example uses `direction = NORTH` and `x=0, y=0` to ensure those values for a `robot` even if they are not initally passed. [robot-simulator](../exercise-concepts/robot-simulator.md) diff --git a/reference/concepts/dict_comprehension.md b/reference/concepts/dict_comprehension.md new file mode 100644 index 00000000..952ea5ad --- /dev/null +++ b/reference/concepts/dict_comprehension.md @@ -0,0 +1,5 @@ +# Dictionary comprehension + +Explain the use of `{k: v for k,v in iterable}` to create _dictionaries_. + +TODO: ADD MORE diff --git a/reference/concepts/docstrings.md b/reference/concepts/docstrings.md new file mode 100644 index 00000000..aa1ae9ff --- /dev/null +++ b/reference/concepts/docstrings.md @@ -0,0 +1,5 @@ +# Docstrings + +TODO: ADD MORE + +- used to document the function, normally situated right below `def func():` [reverse-string](../exercise-concepts/reverse-string.md) diff --git a/reference/concepts/duck_typing.md b/reference/concepts/duck_typing.md new file mode 100644 index 00000000..964dea70 --- /dev/null +++ b/reference/concepts/duck_typing.md @@ -0,0 +1,6 @@ +# Duck typing + +TODO: ADD MORE + +- Python is also a good example of "Duck typing," to wit, "if it walks like a duck, talks like a duck, it's a duck.". This is accomplished partly with "magic" or "dunder" methods (double-under) that provide various interfaces to an object. If an object implements `__iter__` and `__next__`, it can be iterated through; it doesn't matter what type the object actually is. [hamming](../exercise-concepts/hamming.md) +- the exercise supports any argument that supports modular division and comparison to integers (ie int, float, Decimal) [leap](../exercise-concepts/leap.md) diff --git a/reference/concepts/dunder_methods.md b/reference/concepts/dunder_methods.md new file mode 100644 index 00000000..c3fb81f3 --- /dev/null +++ b/reference/concepts/dunder_methods.md @@ -0,0 +1,10 @@ +# Dunder methods + +TODO: ADD MORE + +- the exercise relies on the `__init__` dunder method to control class instantiation [allergies](../exercise-concepts/allergies.md) +- student needs to know when to use dunder methods `__init__` and `__str__` [binary-search-tree](../exercise-concepts/binary-search-tree.md) +- "dunder" -> "double under", referring to the names of these methods being prefixed with two underscores, e.g. `__init__`. There is no formal privacy in Python, but conventionally a single underscore indicates a private method, or one that the programmer should assume may change at any time; methods without an underscore are considered part of an object's public API. Double underscores are even more special - they are used by Python's builtin functions like `len()`, for example, to allow objects to implement various interfaces and functionality. They can also be used for operator overloading. If you have a custom class that you would like to be able to compare to other instances of the same class, implementing `__lt__`, `__gt__`, `__eq__` etc. allow programmers to use the `>`, `<`, `=` operators. Dunder methods allow programmers to build useful objects with simple interfaces, i.e. you can add two instances together using `+` instead of writing something like `instance1.add(instance2)`. [hamming](../exercise-concepts/hamming.md) +- the example uses the `__init__` magic method as its constructor for the class [matrix](../exercise-concepts/matrix.md) +- User defined classes can (and generally do) overload the `__init__` method, whose first argument is `self`, because the result of `__init__` is a class *instance*. [phone-number](../exercise-concepts/phone-number.md) +- The example uses `__init__` as a constructor for the class, which also calls `__new__`. In addition, the example uses `__call__()` via the appending of `()` to instance method names, and `__eq__()` (_rich compairison_) via the use of `==` [robot-simulator](../exercise-concepts/robot-simulator.md) diff --git a/reference/concepts/dynamic_typing.md b/reference/concepts/dynamic_typing.md new file mode 100644 index 00000000..0cef222d --- /dev/null +++ b/reference/concepts/dynamic_typing.md @@ -0,0 +1,5 @@ +# Dynamic typing + +TODO: ADD MORE + +- Python is "dynamically typed," meaning that variable names are bound to objects only, not to a particular type. You can assign `foo` to a string, and then reassign it to an `int` with no issues. Because this applies to the named parameters in function / method signatures as well Python's callables are treated as "polymorphic-by-default", even though the code may only work with a limited number of types at runtime. diff --git a/reference/concepts/enumerated_values.md b/reference/concepts/enumerated_values.md new file mode 100644 index 00000000..24f41b6a --- /dev/null +++ b/reference/concepts/enumerated_values.md @@ -0,0 +1,5 @@ +# Enumerated values + +TODO: ADD MORE + +- the exercise relies on a fixed enumeration of possible values in a data structure [allergies](../exercise-concepts/allergies.md) diff --git a/reference/concepts/equality_operator.md b/reference/concepts/equality_operator.md new file mode 100644 index 00000000..e941a5b0 --- /dev/null +++ b/reference/concepts/equality_operator.md @@ -0,0 +1,5 @@ +# Equality operator + +TODO: ADD MORE + +- the `==` operator calls the dunder method `__eq__()`. By default, objects of different types are never considered equal to each other unless they are numerical types (ie int, float) or have otherwise overloaded the default implementation of the `__eq__` dunder method. `==` is always defined, but for some object types (_like class objects_) it is equivalent to calling `is`. See [`__eq__`](https: //docs.python.org/3/reference/datamodel.html#object.__eq__) for additional details. This exercise uses the equality operator to test that the `self.direction` attribute is equal to one of the constant values defined. [robot-simulator](../exercise-concepts/robot-simulator.md) diff --git a/reference/concepts/equivalence.md b/reference/concepts/equivalence.md new file mode 100644 index 00000000..d569989a --- /dev/null +++ b/reference/concepts/equivalence.md @@ -0,0 +1,5 @@ +# Equivalence + +TODO: ADD MORE + +- the exercise relies on the `==` and `!=` operators to check that two values are equivalent (or not) [leap](../exercise-concepts/leap.md) diff --git a/reference/concepts/everything_is_an_object.md b/reference/concepts/everything_is_an_object.md new file mode 100644 index 00000000..8d8df80e --- /dev/null +++ b/reference/concepts/everything_is_an_object.md @@ -0,0 +1,5 @@ +# Objects + +Explain "everything is an object". + +TODO: ADD MORE diff --git a/reference/concepts/exception_catching.md b/reference/concepts/exception_catching.md new file mode 100644 index 00000000..18e5cce8 --- /dev/null +++ b/reference/concepts/exception_catching.md @@ -0,0 +1,5 @@ +# Exception catching + +TODO: ADD MORE + +- `Exceptions` can be caught from outside the scope where they are raised, using the `try/except` syntax. All `Exceptions` types inherit from the base class, `Exception` and thus can be caught by either checking specifically for the type of Exception, or for any Exception [hamming](../exercise-concepts/hamming.md) diff --git a/reference/concepts/exception_handling.md b/reference/concepts/exception_handling.md new file mode 100644 index 00000000..2211901b --- /dev/null +++ b/reference/concepts/exception_handling.md @@ -0,0 +1,5 @@ +# Exception handling + +TODO: ADD MORE + +- the exercise requires Exception handling [hamming](../exercise-concepts/hamming.md) diff --git a/reference/concepts/exception_hierarchy.md b/reference/concepts/exception_hierarchy.md new file mode 100644 index 00000000..2fcea18d --- /dev/null +++ b/reference/concepts/exception_hierarchy.md @@ -0,0 +1,5 @@ +# Exception hierarchy + +TODO: ADD MORE + +- the idiomatic `Exception` type is a `ValueError`, meaning the input is incorrect [hamming](../exercise-concepts/hamming.md) diff --git a/reference/concepts/exception_message.md b/reference/concepts/exception_message.md new file mode 100644 index 00000000..c7e3faef --- /dev/null +++ b/reference/concepts/exception_message.md @@ -0,0 +1,6 @@ +# Exception message + +TODO: ADD MORE + +- the user can use a custom error message inside the mentioned `ValueError` [variable-length-quantity](../exercise-concepts/variable-length-quantity.md) +- Custom error messages can (and should) be supplied to an Exception when raised [hamming](../exercise-concepts/hamming.md) diff --git a/reference/concepts/exceptions.md b/reference/concepts/exceptions.md new file mode 100644 index 00000000..a173b0b1 --- /dev/null +++ b/reference/concepts/exceptions.md @@ -0,0 +1,3 @@ +# Exceptions + +This should be in the root reference. diff --git a/reference/concepts/expressions.md b/reference/concepts/expressions.md new file mode 100644 index 00000000..79607a00 --- /dev/null +++ b/reference/concepts/expressions.md @@ -0,0 +1,5 @@ +# Expressions + +TODO: ADD MORE + +- the exercise relies on writing an expression that will be evaluated to a return value [leap](../exercise-concepts/leap.md) diff --git a/reference/concepts/for_loops.md b/reference/concepts/for_loops.md new file mode 100644 index 00000000..23d2336f --- /dev/null +++ b/reference/concepts/for_loops.md @@ -0,0 +1,7 @@ +# For loops + +TODO: ADD MORE + +- the `for ... in` concept is useful to loop over the lists [variable-length-quantity](../exercise-concepts/variable-length-quantity.md) +- The example solution uses `for` loops to iterate over various function inputs. [markdown](../exercise-concepts/markdown.md) +- iterating over the passed in `matrix` string using a `for` loop to extract "rows" and "columns" that are appended to a list [matrix](../exercise-concepts/matrix.md) diff --git a/reference/concepts/function_definition.md b/reference/concepts/function_definition.md new file mode 100644 index 00000000..be9c1089 --- /dev/null +++ b/reference/concepts/function_definition.md @@ -0,0 +1,7 @@ +# Function definition + +TODO: ADD MORE + +- functions are defined and named using the `def` keyword [hamming](../exercise-concepts/hamming.md) +- A named (_and often reusable_) section of code that performs a specific task. It may or may not have _arguments_ passed in, and may or may not _return_ data. Created using the `def` keyword. [rna-transcription](../exercise-concepts/rna-transcription.md) +- Tests for this exercise expect a function named `parse` that can be called to transform the _markdown_ formatted text and return HTML formatted text. [markdown](../exercise-concepts/markdown.md) diff --git a/reference/concepts/function_signature.md b/reference/concepts/function_signature.md new file mode 100644 index 00000000..f61a8892 --- /dev/null +++ b/reference/concepts/function_signature.md @@ -0,0 +1,5 @@ +# Function signature + +TODO: ADD MORE + +- functions take named arguments which are accessible within the body of the function; this one requires the student to make a function that accepts 2 [hamming](../exercise-concepts/hamming.md) diff --git a/reference/concepts/generator_comprehension.md b/reference/concepts/generator_comprehension.md new file mode 100644 index 00000000..5d8f88a4 --- /dev/null +++ b/reference/concepts/generator_comprehension.md @@ -0,0 +1,7 @@ +# Generator comprehension + +Explain the use of `(i for i in iterable)` to create _generators_. + +TODO: ADD MORE + +- a generator comprehension is passed to `sum()` to drive summation without storing all the values in a list first [hamming](../exercise-concepts/hamming.md) diff --git a/reference/concepts/generators.md b/reference/concepts/generators.md new file mode 100644 index 00000000..8950035d --- /dev/null +++ b/reference/concepts/generators.md @@ -0,0 +1,5 @@ +# Generators + +TODO: ADD MORE + +- generators calculate then `yield` a value one at a time, as opposed to lists which calculate and return all values in memory at once. A generator will pick up where it leaves off, and generate one item at a time, on demand [hamming](../exercise-concepts/hamming.md) diff --git a/reference/concepts/identity_testing.md b/reference/concepts/identity_testing.md new file mode 100644 index 00000000..66ff64b9 --- /dev/null +++ b/reference/concepts/identity_testing.md @@ -0,0 +1,5 @@ +# Identity testing + +TODO: ADD MORE + +- the best way to check if an element is `None` is via the _identity_ operator, `is` [binary-search-tree](../exercise-concepts/binary-search-tree.md) diff --git a/reference/concepts/immutability.md b/reference/concepts/immutability.md new file mode 100644 index 00000000..a021b589 --- /dev/null +++ b/reference/concepts/immutability.md @@ -0,0 +1,6 @@ +# Immutability + +TODO: ADD MORE + +- strings are immutable, and so cannot have values assigned; new strings can be created, however [phone-number](../exercise-concepts/phone-number.md) +- `text` str in Python is [immutable](https://docs.python.org/3/library/stdtypes.html#text-sequence-type-str). [reverse-string](../exercise-concepts/reverse-string.md) diff --git a/reference/concepts/implicit_self.md b/reference/concepts/implicit_self.md new file mode 100644 index 00000000..8b1798b7 --- /dev/null +++ b/reference/concepts/implicit_self.md @@ -0,0 +1,9 @@ +# Implicit self + +TODO: ADD MORE + +- the example uses the `self` implicit argument for methods and properties linked to a specific instance of the class [matrix](../exercise-concepts/matrix.md) +- the example uses `self` for methods and properties linked to a specific instance of the class. [robot-simulator](../exercise-concepts/robot-simulator.md) +- the exercise relies on the implied passing of `self` as the first parameter of bound methods [allergies](../exercise-concepts/allergies.md) +- student needs to know how to use statement `self` in a class [binary-search-tree](../exercise-concepts/binary-search-tree.md) +- within the class definition, methods and properties can be accessed via the `self.` notation [phone-number](../exercise-concepts/phone-number.md) diff --git a/reference/concepts/importing.md b/reference/concepts/importing.md new file mode 100644 index 00000000..33a73141 --- /dev/null +++ b/reference/concepts/importing.md @@ -0,0 +1,7 @@ +# Importing + +TODO: ADD MORE + +- to use the module, the `import` syntax can be used [phone-number](../exercise-concepts/phone-number.md) +- Both the original code to be refactored for the exercise and the example solution use the `import` keyword to import the `re` module in support of Regular Expressions in python. [markdown](../exercise-concepts/markdown.md) +- a reasonably readable solution will require importing from the standard library [allergies](../exercise-concepts/allergies.md) diff --git a/reference/concepts/indexing.md b/reference/concepts/indexing.md new file mode 100644 index 00000000..03aa6886 --- /dev/null +++ b/reference/concepts/indexing.md @@ -0,0 +1,7 @@ +# Indexing + +TODO: ADD MORE + +- the "rows" and "columns" of this exercise need to be retrieved from a list of lists via index [matrix](../exercise-concepts/matrix.md) +- for iterables, individual items can be accessed with `stringname[x]` notation. Negative numbers start to count backwards [phone-number](../exercise-concepts/phone-number.md) +- finding a value by key in a dictionary using `[]` The example uses passed in move arguments as `keys` to look up corresponding `values` (_method names_) for moving the robot in the _instructions_ dictionary. [robot-simulator](../exercise-concepts/robot-simulator.md) diff --git a/reference/concepts/inequality.md b/reference/concepts/inequality.md new file mode 100644 index 00000000..3ac1373d --- /dev/null +++ b/reference/concepts/inequality.md @@ -0,0 +1,5 @@ +# Inequality + +TODO: ADD MORE + +- this solution checks if `a` is not equal to `b`. [hamming](../exercise-concepts/hamming.md) diff --git a/reference/concepts/initialization.md b/reference/concepts/initialization.md new file mode 100644 index 00000000..20979b99 --- /dev/null +++ b/reference/concepts/initialization.md @@ -0,0 +1,5 @@ +# Initialization + +TODO: ADD MORE + +- customizing object instatiation with actions and persisting data. The example uses `__init__` to persist a `compass` object and x, y coordinates assigned to instance attributes. [robot-simulator](../exercise-concepts/robot-simulator.md) diff --git a/reference/concepts/instance_attributes.md b/reference/concepts/instance_attributes.md new file mode 100644 index 00000000..1ee02d76 --- /dev/null +++ b/reference/concepts/instance_attributes.md @@ -0,0 +1,5 @@ +# Instance attributes + +TODO: ADD MORE + +- this exercise rquires one or more instance attributes to persist passed in data. [robot-simulator](../exercise-concepts/robot-simulator.md) diff --git a/reference/concepts/instance_methods.md b/reference/concepts/instance_methods.md new file mode 100644 index 00000000..4a70d651 --- /dev/null +++ b/reference/concepts/instance_methods.md @@ -0,0 +1,9 @@ +# Instance methods + +TODO: ADD MORE + +- the exercise relies on the `def` statement to create an instance method [allergies](../exercise-concepts/allergies.md) +- use of `def` to define a class's methods [clock](../exercise-concepts/clock.md) +- classes can have instance *methods* which are called from an instance of the class (as opposed to class methods, called from the Class itself). The first parameter of an instance method is always `self`, which is provided when calling from the instance (i.e. the programmer does not need to pass it as an argument explicitly). Static methods are methods called from the class itself, and are not connected to an instance of the class. They have access to class attributes (those defined on the class, not connected to the `self`), and do not require an instance of the class to exist. Classes can also define a `property` by using the `@property` decorator (not shown here); a `property` can be "lazily evaluated" to avoid uneeded computation [phone-number](../exercise-concepts/phone-number.md) +- tests for this exercises require one or more instance methods that will return a specified row or column list of the `matrix`. [matrix](../exercise-concepts/matrix.md) +- tests for this exercises require one or more instance methods that will take in a set of starting coordinates and a bearing and then accept a series of instructions that "move" the instance to a new set of coordinates and bearing. [robot-simulator](../exercise-concepts/robot-simulator.md) diff --git a/reference/concepts/instance_properties.md b/reference/concepts/instance_properties.md new file mode 100644 index 00000000..f4a05ee9 --- /dev/null +++ b/reference/concepts/instance_properties.md @@ -0,0 +1,5 @@ +# Instance properties + +TODO: ADD MORE + +- this exercise rquires one or more instance properties to persist passed in data. [matrix](../exercise-concepts/matrix.md) diff --git a/reference/concepts/instantiation.md b/reference/concepts/instantiation.md new file mode 100644 index 00000000..ca476424 --- /dev/null +++ b/reference/concepts/instantiation.md @@ -0,0 +1,6 @@ +# Instantiation + +TODO: ADD MORE + +- creating different instances of the `robot` class with different data representing different starting positions and bearing are tested. [robot-simulator](../exercise-concepts/robot-simulator.md) +- creating different instances with different data representing different `matrices` is tested [matrix](../exercise-concepts/matrix.md) diff --git a/reference/concepts/integer_comparison.md b/reference/concepts/integer_comparison.md new file mode 100644 index 00000000..46a14228 --- /dev/null +++ b/reference/concepts/integer_comparison.md @@ -0,0 +1,5 @@ +# Integer comparison + +TODO: ADD MORE + +- concept required to solve the exercise [binary-search-tree](../exercise-concepts/binary-search-tree.md) diff --git a/reference/concepts/iterables.md b/reference/concepts/iterables.md new file mode 100644 index 00000000..47295718 --- /dev/null +++ b/reference/concepts/iterables.md @@ -0,0 +1,8 @@ +# Iterable + +TODO: ADD MORE + +- strings are iterable, which provides a lot of opportunity to leverage Python functions against them [hamming](../exercise-concepts/hamming.md) +- understanding that strings, lists, and other data structures can be iterated over in the same fashion [matrix](../exercise-concepts/matrix.md) +- characters in a string are *iterables* and are subject to index and slice access as described below [phone-number](../exercise-concepts/phone-number.md) +- The example solution uses the `for _ in _` syntax to iterate over a list of lines. This is possible because a list is an `iterable`. [markdown](../exercise-concepts/markdown.md) diff --git a/reference/concepts/iteration.md b/reference/concepts/iteration.md new file mode 100644 index 00000000..a16c41ad --- /dev/null +++ b/reference/concepts/iteration.md @@ -0,0 +1,7 @@ +# Iteration + +TODO: ADD MORE + +- the passed-in string is iterated over, and split into rows. The row lists are iterated over and split into elements [matrix](../exercise-concepts/matrix.md) +- the example uses a `for loop` to iterate through the letters of the passed-in `commands` string and looks up the corresponding values in a dictionary, so that the appropriate methods can be called to move the `robot`. [robot-simulator](../exercise-concepts/robot-simulator.md) +- the `for ... in` concept is useful to loop over the lists [variable-length-quantity](../exercise-concepts/variable-length-quantity.md) diff --git a/reference/concepts/iterators.md b/reference/concepts/iterators.md new file mode 100644 index 00000000..33ef9c72 --- /dev/null +++ b/reference/concepts/iterators.md @@ -0,0 +1,5 @@ +# Iterators + +TODO: ADD MORE + +- the example solution for this exercise uses `zip()`, which returns an _iterator_. [matrix](../exercise-concepts/matrix.md) diff --git a/reference/concepts/keyword_only_parameters.md b/reference/concepts/keyword_only_parameters.md new file mode 100644 index 00000000..a216f871 --- /dev/null +++ b/reference/concepts/keyword_only_parameters.md @@ -0,0 +1,3 @@ +# Keyword-only parameters + +TODO: Explain the concept of keyword-only parameters after the `*` punctuation in function signatures. diff --git a/reference/concepts/keyword_parameters.md b/reference/concepts/keyword_parameters.md new file mode 100644 index 00000000..a2f5a1be --- /dev/null +++ b/reference/concepts/keyword_parameters.md @@ -0,0 +1,3 @@ +# Keyword parameters + +TODO: Explain the concept of keyword parameters in function signatures. diff --git a/reference/concepts/keywords/and.md b/reference/concepts/keywords/and.md new file mode 100644 index 00000000..c9140d15 --- /dev/null +++ b/reference/concepts/keywords/and.md @@ -0,0 +1,8 @@ +# `and` + +TODO: ADD MORE DETAIL + +See the Python [documentation entry][keyword-and-docs], as well as [this blog post][keyword-and-etymology] for more details. + +[keyword-and-docs]: https://docs.python.org/3/library/stdtypes.html#boolean-operations-and-or-not +[keyword-and-etymology]: https://yawpitchroll.com/posts/the-35-words-you-need-to-python/#and diff --git a/reference/concepts/keywords/as.md b/reference/concepts/keywords/as.md new file mode 100644 index 00000000..520f51ad --- /dev/null +++ b/reference/concepts/keywords/as.md @@ -0,0 +1,7 @@ +# `as` + +TODO: ADD MORE DETAIL + +See [this blog post][keyword-as-etymology] for more details. + +[keyword-as-etymology]: https://yawpitchroll.com/posts/the-35-words-you-need-to-python/#as diff --git a/reference/concepts/keywords/assert.md b/reference/concepts/keywords/assert.md new file mode 100644 index 00000000..0ddfc187 --- /dev/null +++ b/reference/concepts/keywords/assert.md @@ -0,0 +1,8 @@ +# `assert` + +TODO: ADD MORE DETAIL + +See the Python [documentation entry][keyword-assert-docs], as well as [this blog post][keyword-assert-etymology] for more details. + +[keyword-assert-docs]: https://docs.python.org/3/reference/simple_stmts.html#the-assert-statement +[keyword-assert-etymology]: https://yawpitchroll.com/posts/the-35-words-you-need-to-python/#assert diff --git a/reference/concepts/keywords/async.md b/reference/concepts/keywords/async.md new file mode 100644 index 00000000..0408f768 --- /dev/null +++ b/reference/concepts/keywords/async.md @@ -0,0 +1,8 @@ +# `async` + +TODO: ADD MORE DETAIL + +See the Python [documentation entry][keyword-async-docs], as well as [this blog post][keyword-async-etymology] for more details. + +[keyword-async-docs]: https://docs.python.org/3/reference/compound_stmts.html#coroutine-function-definition +[keyword-async-etymology]: https://yawpitchroll.com/posts/the-35-words-you-need-to-python/#async diff --git a/reference/concepts/keywords/await.md b/reference/concepts/keywords/await.md new file mode 100644 index 00000000..f96ddc3d --- /dev/null +++ b/reference/concepts/keywords/await.md @@ -0,0 +1,8 @@ +# `await` + +TODO: ADD MORE DETAIL + +See the Python [documentation entry][keyword-await-docs], as well as [this blog post][keyword-await-etymology] for more details. + +[keyword-await-docs]: https://docs.python.org/3/reference/expressions.html#await-expression +[keyword-await-etymology]: https://yawpitchroll.com/posts/the-35-words-you-need-to-python/#await diff --git a/reference/concepts/keywords/break.md b/reference/concepts/keywords/break.md new file mode 100644 index 00000000..67ecaabb --- /dev/null +++ b/reference/concepts/keywords/break.md @@ -0,0 +1,8 @@ +# `break` + +TODO: ADD MORE DETAIL + +See the Python [documentation entry][keyword-break-docs], as well as [this blog post][keyword-break-etymology] for more details. + +[keyword-break-docs]: https://docs.python.org/3/reference/simple_stmts.html#the-break-statement +[keyword-break-etymology]: https://yawpitchroll.com/posts/the-35-words-you-need-to-python/#break diff --git a/reference/concepts/keywords/class.md b/reference/concepts/keywords/class.md new file mode 100644 index 00000000..a23e34f4 --- /dev/null +++ b/reference/concepts/keywords/class.md @@ -0,0 +1,8 @@ +# `class` + +TODO: ADD MORE DETAIL + +See the Python [documentation entry][keyword-class-docs], as well as [this blog post][keyword-class-etymology] for more details. + +[keyword-class-docs]: https://docs.python.org/3/reference/compound_stmts.html#class-definitions +[keyword-class-etymology]: https://yawpitchroll.com/posts/the-35-words-you-need-to-python/#class diff --git a/reference/concepts/keywords/continue.md b/reference/concepts/keywords/continue.md new file mode 100644 index 00000000..ee4ffdb1 --- /dev/null +++ b/reference/concepts/keywords/continue.md @@ -0,0 +1,8 @@ +# `continue` + +TODO: ADD MORE DETAIL + +See the Python [documentation entry][keyword-continue-docs], as well as [this blog post][keyword-continue-etymology] for more details. + +[keyword-continue-docs]: https://docs.python.org/3/reference/simple_stmts.html#the-continue-statement +[keyword-continue-etymology]: https://yawpitchroll.com/posts/the-35-words-you-need-to-python/#continue diff --git a/reference/concepts/keywords/def.md b/reference/concepts/keywords/def.md new file mode 100644 index 00000000..90c9f2fe --- /dev/null +++ b/reference/concepts/keywords/def.md @@ -0,0 +1,8 @@ +# `def` + +TODO: ADD MORE DETAIL + +See the Python [documentation entry][keyword-def-docs], as well as [this blog post][keyword-def-etymology] for more details. + +[keyword-def-docs]: https://docs.python.org/3/reference/compound_stmts.html#function-definitions +[keyword-def-etymology]: https://yawpitchroll.com/posts/the-35-words-you-need-to-python/#def diff --git a/reference/concepts/keywords/del.md b/reference/concepts/keywords/del.md new file mode 100644 index 00000000..a7d62403 --- /dev/null +++ b/reference/concepts/keywords/del.md @@ -0,0 +1,8 @@ +# `del` + +TODO: ADD MORE DETAIL + +See the Python [documentation entry][keyword-del-docs], as well as [this blog post][keyword-del-etymology] for more details. + +[keyword-del-docs]: https://docs.python.org/3/reference/simple_stmts.html#the-del-statement +[keyword-del-etymology]: https://yawpitchroll.com/posts/the-35-words-you-need-to-python/#del diff --git a/reference/concepts/keywords/elif.md b/reference/concepts/keywords/elif.md new file mode 100644 index 00000000..79751358 --- /dev/null +++ b/reference/concepts/keywords/elif.md @@ -0,0 +1,7 @@ +# `elif` + +TODO: ADD MORE DETAIL + +See [this blog post][keyword-elif-etymology] for more details. + +[keyword-elif-etymology]: https://yawpitchroll.com/posts/the-35-words-you-need-to-python/#elif diff --git a/reference/concepts/keywords/else.md b/reference/concepts/keywords/else.md new file mode 100644 index 00000000..a07a9a67 --- /dev/null +++ b/reference/concepts/keywords/else.md @@ -0,0 +1,7 @@ +# `else` + +TODO: ADD MORE DETAIL + +See [this blog post][keyword-else-etymology] for more details. + +[keyword-else-etymology]: https://yawpitchroll.com/posts/the-35-words-you-need-to-python/#else diff --git a/reference/concepts/keywords/except.md b/reference/concepts/keywords/except.md new file mode 100644 index 00000000..87b3c1fe --- /dev/null +++ b/reference/concepts/keywords/except.md @@ -0,0 +1,7 @@ +# `except` + +TODO: ADD MORE DETAIL + +See [this blog post][keyword-except-etymology] for more details. + +[keyword-except-etymology]: https://yawpitchroll.com/posts/the-35-words-you-need-to-python/#except diff --git a/reference/concepts/keywords/false.md b/reference/concepts/keywords/false.md new file mode 100644 index 00000000..82a43d3e --- /dev/null +++ b/reference/concepts/keywords/false.md @@ -0,0 +1,8 @@ +# `false` + +TODO: ADD MORE DETAIL + +See the Python [documentation entry][keyword-false-docs], as well as [this blog post][keyword-false-etymology] for more details. + +[keyword-false-docs]: https://docs.python.org/3.7/library/stdtypes.html#boolean-values +[keyword-false-etymology]: https://yawpitchroll.com/posts/the-35-words-you-need-to-python/#false diff --git a/reference/concepts/keywords/finally.md b/reference/concepts/keywords/finally.md new file mode 100644 index 00000000..be385691 --- /dev/null +++ b/reference/concepts/keywords/finally.md @@ -0,0 +1,7 @@ +# `finally` + +TODO: ADD MORE DETAIL + +See [this blog post][keyword-finally-etymology] for more details. + +[keyword-finally-etymology]: https://yawpitchroll.com/posts/the-35-words-you-need-to-python/#finally diff --git a/reference/concepts/keywords/for.md b/reference/concepts/keywords/for.md new file mode 100644 index 00000000..a226a9c8 --- /dev/null +++ b/reference/concepts/keywords/for.md @@ -0,0 +1,8 @@ +# `for` + +TODO: ADD MORE DETAIL + +See the Python [documentation entry][keyword-for-docs], as well as [this blog post][keyword-for-etymology] for more details. + +[keyword-for-docs]: https://docs.python.org/3/reference/compound_stmts.html#the-for-statement +[keyword-for-etymology]: https://yawpitchroll.com/posts/the-35-words-you-need-to-python/#for diff --git a/reference/concepts/keywords/from.md b/reference/concepts/keywords/from.md new file mode 100644 index 00000000..901ba78b --- /dev/null +++ b/reference/concepts/keywords/from.md @@ -0,0 +1,7 @@ +# `from` + +TODO: ADD MORE DETAIL + +See [this blog post][keyword-from-etymology] for more details. + +[keyword-from-etymology]: https://yawpitchroll.com/posts/the-35-words-you-need-to-python/#from diff --git a/reference/concepts/keywords/global.md b/reference/concepts/keywords/global.md new file mode 100644 index 00000000..a87e861e --- /dev/null +++ b/reference/concepts/keywords/global.md @@ -0,0 +1,8 @@ +# `global` + +TODO: ADD MORE DETAIL + +See the Python [documentation entry][keyword-global-docs], as well as [this blog post][keyword-global-etymology] for more details. + +[keyword-global-docs]: https://docs.python.org/3/reference/simple_stmts.html#the-global-statement +[keyword-global-etymology]: https://yawpitchroll.com/posts/the-35-words-you-need-to-python/#global diff --git a/reference/concepts/keywords/if.md b/reference/concepts/keywords/if.md new file mode 100644 index 00000000..464d56e9 --- /dev/null +++ b/reference/concepts/keywords/if.md @@ -0,0 +1,8 @@ +# `if` + +TODO: ADD MORE DETAIL + +See the Python [documentation entry][keyword-if-docs], as well as [this blog post][keyword-if-etymology] for more details. + +[keyword-if-docs]: https://docs.python.org/3/reference/compound_stmts.html#the-if-statement +[keyword-if-etymology]: https://yawpitchroll.com/posts/the-35-words-you-need-to-python/#if diff --git a/reference/concepts/keywords/import.md b/reference/concepts/keywords/import.md new file mode 100644 index 00000000..bceeb4cf --- /dev/null +++ b/reference/concepts/keywords/import.md @@ -0,0 +1,8 @@ +# `import` + +TODO: ADD MORE DETAIL + +See the Python [documentation entry][keyword-import-docs], as well as [this blog post][keyword-import-etymology] for more details. + +[keyword-import-docs]: https://docs.python.org/3/reference/simple_stmts.html#the-import-statement +[keyword-import-etymology]: https://yawpitchroll.com/posts/the-35-words-you-need-to-python/#import diff --git a/reference/concepts/keywords/in.md b/reference/concepts/keywords/in.md new file mode 100644 index 00000000..4860f866 --- /dev/null +++ b/reference/concepts/keywords/in.md @@ -0,0 +1,8 @@ +# `in` + +TODO: ADD MORE DETAIL + +See the Python [documentation entry][keyword-in-docs], as well as [this blog post][keyword-in-etymology] for more details. + +[keyword-in-docs]: https://docs.python.org/3/reference/expressions.html#membership-test-operations +[keyword-in-etymology]: https://yawpitchroll.com/posts/the-35-words-you-need-to-python/#in diff --git a/reference/concepts/keywords/is.md b/reference/concepts/keywords/is.md new file mode 100644 index 00000000..e5d291b9 --- /dev/null +++ b/reference/concepts/keywords/is.md @@ -0,0 +1,8 @@ +# `is` + +TODO: ADD MORE DETAIL + +See the Python [documentation entry][keyword-is-docs], as well as [this blog post][keyword-is-etymology] for more details. + +[keyword-is-docs]: https://docs.python.org/3/reference/expressions.html#is +[keyword-is-etymology]: https://yawpitchroll.com/posts/the-35-words-you-need-to-python/#is diff --git a/reference/concepts/keywords/lambda.md b/reference/concepts/keywords/lambda.md new file mode 100644 index 00000000..ee9eee1a --- /dev/null +++ b/reference/concepts/keywords/lambda.md @@ -0,0 +1,8 @@ +# `lambda` + +TODO: ADD MORE DETAIL + +See the Python [documentation entry][keyword-lambda-docs], as well as [this blog post][keyword-lambda-etymology] for more details. + +[keyword-lambda-docs]: https://docs.python.org/3/reference/expressions.html#lambda +[keyword-lambda-etymology]: https://yawpitchroll.com/posts/the-35-words-you-need-to-python/#lambda diff --git a/reference/concepts/keywords/none.md b/reference/concepts/keywords/none.md new file mode 100644 index 00000000..5dfebc57 --- /dev/null +++ b/reference/concepts/keywords/none.md @@ -0,0 +1,14 @@ +# `none` + +Python's null type, referred to when a null or "placeholder" is needed. It is in and of itself a singleton in any given interpreter session, so `None is None` is always considered True. + +None is used in both [binary-search-tree][binary-search-tree] and [markdown][markdown]. + +TODO: ADD MORE DETAIL + +See the Python [documentation entry][keyword-none-docs], as well as [this blog post][keyword-none-etymology] for more details. + +[binary-search-tree]: ../../exercise-concepts/binary-search-tree.md +[markdown]: ../../exercise-concepts/markdown.md +[keyword-none-docs]: https://docs.python.org/3/library/stdtypes.html#the-null-object +[keyword-none-etymology]: https://yawpitchroll.com/posts/the-35-words-you-need-to-python/#none diff --git a/reference/concepts/keywords/nonlocal.md b/reference/concepts/keywords/nonlocal.md new file mode 100644 index 00000000..0fb01e16 --- /dev/null +++ b/reference/concepts/keywords/nonlocal.md @@ -0,0 +1,8 @@ +# `nonlocal` + +TODO: ADD MORE DETAIL + +See the Python [documentation entry][keyword-nonlocal-docs], as well as [this blog post][keyword-nonlocal-etymology] for more details. + +[keyword-nonlocal-docs]: https://docs.python.org/3/reference/simple_stmts.html#the-nonlocal-statement +[keyword-nonlocal-etymology]: https://yawpitchroll.com/posts/the-35-words-you-need-to-python/#nonlocal diff --git a/reference/concepts/keywords/not.md b/reference/concepts/keywords/not.md new file mode 100644 index 00000000..18f1c9fe --- /dev/null +++ b/reference/concepts/keywords/not.md @@ -0,0 +1,8 @@ +# `not` + +TODO: ADD MORE DETAIL + +See the Python [documentation entry][keyword-not-docs], as well as [this blog post][keyword-not-etymology] for more details. + +[keyword-not-docs]: https://docs.python.org/3/library/stdtypes.html#boolean-operations-and-or-not +[keyword-not-etymology]: https://yawpitchroll.com/posts/the-35-words-you-need-to-python/#not diff --git a/reference/concepts/keywords/or.md b/reference/concepts/keywords/or.md new file mode 100644 index 00000000..82b13d00 --- /dev/null +++ b/reference/concepts/keywords/or.md @@ -0,0 +1,8 @@ +# `or` + +TODO: ADD MORE DETAIL + +See the Python [documentation entry][keyword-or-docs], as well as [this blog post][keyword-or-etymology] for more details. + +[keyword-or-docs]: https://docs.python.org/3/library/stdtypes.html#boolean-operations-and-or-not +[keyword-or-etymology]: https://yawpitchroll.com/posts/the-35-words-you-need-to-python/#or diff --git a/reference/concepts/keywords/pass.md b/reference/concepts/keywords/pass.md new file mode 100644 index 00000000..3acae09f --- /dev/null +++ b/reference/concepts/keywords/pass.md @@ -0,0 +1,8 @@ +# `pass` + +TODO: ADD MORE DETAIL + +See the Python [documentation entry][keyword-pass-docs], as well as [this blog post][keyword-pass-etymology] for more details. + +[keyword-pass-docs]: https://docs.python.org/3/tutorial/controlflow.html?highlight=pass#pass-statements +[keyword-pass-etymology]: https://yawpitchroll.com/posts/the-35-words-you-need-to-python/#pass diff --git a/reference/concepts/keywords/raise.md b/reference/concepts/keywords/raise.md new file mode 100644 index 00000000..c4341593 --- /dev/null +++ b/reference/concepts/keywords/raise.md @@ -0,0 +1,8 @@ +# `raise` + +TODO: ADD MORE DETAIL + +See the Python [documentation entry][keyword-raise-docs], as well as [this blog post][keyword-raise-etymology] for more details. + +[keyword-raise-docs]: https://docs.python.org/3/reference/simple_stmts.html#the-raise-statement +[keyword-raise-etymology]: https://yawpitchroll.com/posts/the-35-words-you-need-to-python/#raise diff --git a/reference/concepts/keywords/return.md b/reference/concepts/keywords/return.md new file mode 100644 index 00000000..8dcdc69e --- /dev/null +++ b/reference/concepts/keywords/return.md @@ -0,0 +1,8 @@ +# `return` + +TODO: ADD MORE DETAIL + +See the Python [documentation entry][keyword-return-docs], as well as [this blog post][keyword-return-etymology] for more details. + +[keyword-return-docs]: https://docs.python.org/3/reference/simple_stmts.html#the-return-statement +[keyword-return-etymology]: https://yawpitchroll.com/posts/the-35-words-you-need-to-python/#return diff --git a/reference/concepts/keywords/true.md b/reference/concepts/keywords/true.md new file mode 100644 index 00000000..0e2f819d --- /dev/null +++ b/reference/concepts/keywords/true.md @@ -0,0 +1,8 @@ +# `true` + +TODO: ADD MORE DETAIL + +See the Python [documentation entry][keyword-true-docs], as well as [this blog post][keyword-true-etymology] for more details. + +[keyword-true-docs]: https://docs.python.org/3.7/library/stdtypes.html#boolean-values +[keyword-true-etymology]: https://yawpitchroll.com/posts/the-35-words-you-need-to-python/#true diff --git a/reference/concepts/keywords/try.md b/reference/concepts/keywords/try.md new file mode 100644 index 00000000..901add80 --- /dev/null +++ b/reference/concepts/keywords/try.md @@ -0,0 +1,8 @@ +# `try` + +TODO: ADD MORE DETAIL + +See the Python [documentation entry][keyword-try-docs], as well as [this blog post][keyword-try-etymology] for more details. + +[keyword-try-docs]: https://docs.python.org/3/reference/compound_stmts.html#the-try-statement +[keyword-try-etymology]: https://yawpitchroll.com/posts/the-35-words-you-need-to-python/#try diff --git a/reference/concepts/keywords/while.md b/reference/concepts/keywords/while.md new file mode 100644 index 00000000..e50f20fa --- /dev/null +++ b/reference/concepts/keywords/while.md @@ -0,0 +1,8 @@ +# `while` + +TODO: ADD MORE DETAIL + +See the Python [documentation entry][keyword-while-docs], as well as [this blog post][keyword-while-etymology] for more details. + +[keyword-while-docs]: https://docs.python.org/3/reference/compound_stmts.html#the-while-statement +[keyword-while-etymology]: https://yawpitchroll.com/posts/the-35-words-you-need-to-python/#while diff --git a/reference/concepts/keywords/with.md b/reference/concepts/keywords/with.md new file mode 100644 index 00000000..7b345309 --- /dev/null +++ b/reference/concepts/keywords/with.md @@ -0,0 +1,8 @@ +# `with` + +TODO: ADD MORE DETAIL + +See the Python [documentation entry][keyword-with-docs], as well as [this blog post][keyword-with-etymology] for more details. + +[keyword-with-docs]: https://docs.python.org/3/reference/compound_stmts.html#the-with-statement +[keyword-with-etymology]: https://yawpitchroll.com/posts/the-35-words-you-need-to-python/#with diff --git a/reference/concepts/keywords/yield.md b/reference/concepts/keywords/yield.md new file mode 100644 index 00000000..37cc4ca7 --- /dev/null +++ b/reference/concepts/keywords/yield.md @@ -0,0 +1,8 @@ +# `yield` + +TODO: ADD MORE DETAIL + +See the Python [documentation entry][keyword-yield-docs], as well as [this blog post][keyword-yield-etymology] for more details. + +[keyword-yield-docs]: https://docs.python.org/3/reference/simple_stmts.html#the-yield-statement +[keyword-yield-etymology]: https://yawpitchroll.com/posts/the-35-words-you-need-to-python/#yield diff --git a/reference/concepts/list_comprehension.md b/reference/concepts/list_comprehension.md new file mode 100644 index 00000000..04e7a4cb --- /dev/null +++ b/reference/concepts/list_comprehension.md @@ -0,0 +1,5 @@ +# List comprehension + +Explain the use of `[i for i in iterable]` to create _lists_. + +TODO: ADD MORE diff --git a/reference/concepts/list_methods.md b/reference/concepts/list_methods.md new file mode 100644 index 00000000..205237fa --- /dev/null +++ b/reference/concepts/list_methods.md @@ -0,0 +1,5 @@ +# List methods + +TODO: ADD MORE + +- the use of methods of list could be useful in this exercise. Methods like `append`, `pop`... [variable-length-quantity](../exercise-concepts/variable-length-quantity.md) diff --git a/reference/concepts/lookup_efficiency.md b/reference/concepts/lookup_efficiency.md new file mode 100644 index 00000000..043e3dfa --- /dev/null +++ b/reference/concepts/lookup_efficiency.md @@ -0,0 +1,5 @@ +# Lookup efficiency + +TODO: ADD MORE + +- an efficient solution requires knowing that membership testing is O(1) in **dict** and the **enum.Enum** variants, but is O(N) in **list** and other sequential types [allergies](../exercise-concepts/allergies.md) diff --git a/reference/concepts/membership_testing.md b/reference/concepts/membership_testing.md new file mode 100644 index 00000000..a8a74d46 --- /dev/null +++ b/reference/concepts/membership_testing.md @@ -0,0 +1,7 @@ +# Membership testing + +TODO: ADD MORE + +- this exercise relies on testing membership of a value in a collection of values [allergies](../exercise-concepts/allergies.md) +- the `in` keyword, as in `"s" in "string`, allows the user to check membership in the longer string [phone-number](../exercise-concepts/phone-number.md) +- use of the `in` statement is useful to look for an object into a list [binary-search-tree](../exercise-concepts/binary-search-tree.md) diff --git a/reference/concepts/method_overloading.md b/reference/concepts/method_overloading.md new file mode 100644 index 00000000..bcfff3a5 --- /dev/null +++ b/reference/concepts/method_overloading.md @@ -0,0 +1,5 @@ +# Method overloading + +TODO: ADD MORE + +- students need to overload methods and specifically dunder methods in this exercise [binary-search-tree](../exercise-concepts/binary-search-tree.md) diff --git a/reference/concepts/modular_division.md b/reference/concepts/modular_division.md new file mode 100644 index 00000000..77b80bdd --- /dev/null +++ b/reference/concepts/modular_division.md @@ -0,0 +1,6 @@ +# Modular division + +TODO: ADD MORE + +- the exercise relies on the `%` operator to check if one number is evenly divisible by another [leap](../exercise-concepts/leap.md) +- the example uses the modulus operator to calculate the appropriate _compass_ setting when calling the `right` compass method [robot-simulator](../exercise-concepts/robot-simulator.md) diff --git a/reference/concepts/multiple_assignment.md b/reference/concepts/multiple_assignment.md new file mode 100644 index 00000000..884f19c0 --- /dev/null +++ b/reference/concepts/multiple_assignment.md @@ -0,0 +1,5 @@ +# Multiple assignment + +TODO: ADD MORE + +- Python allows multiple assignment, assigning the items on the left of `=` _in order_ to the values on the right of `=` by forming tuples and then "unpacking" them. This exercise solution uses multiple assignment for the constant values NORTH, EAST, SOUTH, WEST. [robot-simulator](../exercise-concepts/robot-simulator.md) diff --git a/reference/concepts/mutability.md b/reference/concepts/mutability.md new file mode 100644 index 00000000..adb2c78f --- /dev/null +++ b/reference/concepts/mutability.md @@ -0,0 +1,6 @@ +# Mutability + +TODO: ADD MORE + +- in the extended example, knowing there are no protected or private properties in python and adjusting coding patterns [matrix](../exercise-concepts/matrix.md) +- in the example, knowing there are no protected or private properties in python and so consciously mutating `self.x`, `self.y` and `self.compass` through the called instance methods. [robot-simulator](../exercise-concepts/robot-simulator.md) diff --git a/reference/concepts/namespaces.md b/reference/concepts/namespaces.md new file mode 100644 index 00000000..37ff6a4a --- /dev/null +++ b/reference/concepts/namespaces.md @@ -0,0 +1,6 @@ +# Namespaces + +TODO: ADD MORE + +- knowing to use `self`.`` for instance properties and `self` as first argument to instance methods in a class [matrix](../exercise-concepts/matrix.md) +- knowing to use `self.` for instance attributes and `self` as first argument to instance methods in a class. Additionally, the example uses `self.()` to call a previously stored method name. [robot-simulator](../exercise-concepts/robot-simulator.md) diff --git a/reference/concepts/non_public_methods.md b/reference/concepts/non_public_methods.md new file mode 100644 index 00000000..ea55ec3a --- /dev/null +++ b/reference/concepts/non_public_methods.md @@ -0,0 +1,5 @@ +# Non public methods + +TODO: ADD MORE + +- Methods or attributes (including those of an imported module) prefixed with an underscore, `_`, are conventionally treated as "non-public" methods. Python does not support data privacy in the way a language like Java does. Instead convention dictates that methods and attributes that are not prefixed with a single underscore can be expected to remain stable along with semver, i.e. a public method will be backwards compatible with minor version updates, and can change with major version updates. Generally, importing non-public functions or using non-public methods is discouraged, though Python will not explicitly stop the programmer from doing so. [phone-number](../exercise-concepts/phone-number.md) diff --git a/reference/concepts/operator_overloading.md b/reference/concepts/operator_overloading.md new file mode 100644 index 00000000..8343a14e --- /dev/null +++ b/reference/concepts/operator_overloading.md @@ -0,0 +1,5 @@ +# Operator overloading + +TODO: ADD MORE + +- How to overload the `+` and `-` operators using the `__add__` and `__sub__` special methods. [clock](../exercise-concepts/clock.md) diff --git a/reference/concepts/operator_precedence.md b/reference/concepts/operator_precedence.md new file mode 100644 index 00000000..05ce23dc --- /dev/null +++ b/reference/concepts/operator_precedence.md @@ -0,0 +1,5 @@ +# Operator precedence + +TODO: ADD MORE + +- the exercise is most simply stated when the student understands the operator precedence binding rules of Python [leap](../exercise-concepts/leap.md) diff --git a/reference/concepts/operators.md b/reference/concepts/operators.md new file mode 100644 index 00000000..435964e1 --- /dev/null +++ b/reference/concepts/operators.md @@ -0,0 +1,5 @@ +# Operators + +TODO: ADD MORE + +- `!=` is "not equal", which is not the same thing as `is`, or an identity check, but is the inverse of `==`, which is equality [hamming](../exercise-concepts/hamming.md) diff --git a/reference/concepts/order_of_evaluation.md b/reference/concepts/order_of_evaluation.md new file mode 100644 index 00000000..16b26734 --- /dev/null +++ b/reference/concepts/order_of_evaluation.md @@ -0,0 +1,5 @@ +# Order of evaluation + +TODO: ADD MORE + +- the exercise relies on parentheses to explicitly modify the normal order of evaluation of an expression [leap](../exercise-concepts/leap.md) diff --git a/reference/concepts/positional_only_parameters.md b/reference/concepts/positional_only_parameters.md new file mode 100644 index 00000000..706ee503 --- /dev/null +++ b/reference/concepts/positional_only_parameters.md @@ -0,0 +1,3 @@ +# Positional-only parameters + +TODO: Explain the concept of positional-only parameters before the `/` punctuation in function signatures. diff --git a/reference/concepts/positional_parameters.md b/reference/concepts/positional_parameters.md new file mode 100644 index 00000000..5d169dee --- /dev/null +++ b/reference/concepts/positional_parameters.md @@ -0,0 +1,3 @@ +# Positional parameters + +TODO: Explain the concept of positional parameters in function signatures. diff --git a/reference/concepts/powers_of_two.md b/reference/concepts/powers_of_two.md new file mode 100644 index 00000000..488151ef --- /dev/null +++ b/reference/concepts/powers_of_two.md @@ -0,0 +1,5 @@ +# Powers of two + +TODO: ADD MORE + +- the exercise relies on the use of powers of two in fundamental binary (bitwise) operations [allergies](../exercise-concepts/allergies.md) diff --git a/reference/concepts/property_decorator.md b/reference/concepts/property_decorator.md new file mode 100644 index 00000000..cd47df49 --- /dev/null +++ b/reference/concepts/property_decorator.md @@ -0,0 +1,6 @@ +# Property decorator + +TODO: ADD MORE + +- the `property()` built-in is a function that returns a property attribute. When used as a decorator, this transforms the passed-in method into a _getter_ method for read-only attribute with the same name and docstring. [robot-simulator](../exercise-concepts/robot-simulator.md) +- this exercise relies on the `@property` decorator to provide read-only dynamic access to the current list of allergens [allergies](../exercise-concepts/allergies.md) diff --git a/reference/concepts/raise.md b/reference/concepts/raise.md new file mode 100644 index 00000000..ad2dbb51 --- /dev/null +++ b/reference/concepts/raise.md @@ -0,0 +1,7 @@ +# Raise + +TODO: ADD MORE + +- the student is required to raise an `Exception` for incorrect input [hamming](../exercise-concepts/hamming.md) +- an appropriate Exceptions must be raised with the `raise` keyword [phone-number](../exercise-concepts/phone-number.md) +- the user could find useful the `Exception` concept to `raise` a `ValueError` for incorrect input [variable-length-quantity](../exercise-concepts/variable-length-quantity.md) diff --git a/reference/concepts/recursion.md b/reference/concepts/recursion.md new file mode 100644 index 00000000..63b157ca --- /dev/null +++ b/reference/concepts/recursion.md @@ -0,0 +1,5 @@ +# Recursion + +TODO: ADD MORE + +- recursion is a core concept in this exercise [binary-search-tree](../exercise-concepts/binary-search-tree.md) diff --git a/reference/concepts/recursive_data_structures.md b/reference/concepts/recursive_data_structures.md new file mode 100644 index 00000000..cc95e2f7 --- /dev/null +++ b/reference/concepts/recursive_data_structures.md @@ -0,0 +1,8 @@ +# Recursive data structures + +Data structures which refer to themselves, recursively. + +An example is found in [binary-search-tree][binary-search-tree]. +TODO: ADD MORE + +[binary-search-tree]: ../exercise-concepts/binary-search-tree.md diff --git a/reference/concepts/regular_expressions.md b/reference/concepts/regular_expressions.md new file mode 100644 index 00000000..82121007 --- /dev/null +++ b/reference/concepts/regular_expressions.md @@ -0,0 +1,10 @@ +# Regular expressions + +TODO: ADD MORE + +- the `re.sub()` function of the `re` module that replaces a `regular expression` match with a new value. The example solutions use this function in various places to substitute _markdown_ syntax for _HTML_ syntax in the passed in markdown text. [markdown](../exercise-concepts/markdown.md) +- Both the original code to be refactored for this exercise and the example solution import and use the `re` module for Regular Expressions in python. [markdown](../exercise-concepts/markdown.md) +- the `re.match()` function from the `re` module returns a `match` object with any matched values from a specified Regular Expression or pre-compliled Regular Expression. The example uses `re.match()` in multiple places to search for text patterns that need re-formatting or subsitituting. [markdown](../exercise-concepts/markdown.md) +- Various functions in the re module return a `re.Match` _instance_ which in turn has a `Match.group` method. `Match.group` exists even if there are no groups specified in the pattern. See the [Match.group docs](https://docs.python.org/3/library/re.html#re.Match.group) for more detail. [markdown](../exercise-concepts/markdown.md) +- regular expressions is a language of sorts that can detect substrings and extract groups from a string, as well as replace them with something else [phone-number](../exercise-concepts/phone-number.md) +- A Domain Specific Language (DSL) for text processing. Like many other programming languages in use, python supports a quasi-dialect of PCRE (_Perl compatible regular expressions_). `Regular expressions` can be used via the core python `re` module, or the third-party `regex` module. Both the original code to be refactored for this exercise and the example solutions use the core `re` module to access `regular expressions` functionality. [markdown](../exercise-concepts/markdown.md) diff --git a/reference/concepts/return_value.md b/reference/concepts/return_value.md new file mode 100644 index 00000000..5cd84d30 --- /dev/null +++ b/reference/concepts/return_value.md @@ -0,0 +1,13 @@ +# Return value + +TODO: ADD MORE + +- the knowledge of `return` statement could be a useful concept in this exercise [variable-length-quantity](../exercise-concepts/variable-length-quantity.md) +- the function must return a number (int) [hamming](../exercise-concepts/hamming.md) +- Most of the functions in the example solution specify a _return_ value using the `return` keyword. [markdown](../exercise-concepts/markdown.md) +- the exercise must use a `return` statement to return a value to the caller [leap](../exercise-concepts/leap.md) +- this function return a string by this line: `return text[::-1]` [reverse-string](../exercise-concepts/reverse-string.md) +- the `return` keyword is used in a _return statement_ at the end of a function. Exits a function and may or may not pass data or an expression back to calling code. Functions in python without an expicit `return` keyword and statment will return (pass back) the singleton object `none`. The example code _returns_ a copy of the passed-in argument (assumed to be a string) that has been mapped through `str.translate()`, using the table made from `str.maketrans()` [rna-transcription](../exercise-concepts/rna-transcription.md) +- knowing that functions need not have _explicit_ return statements or values but will return `None` if `return` is not specified. Except for the two `@property`-decorated functions, all of the functions in the example omit an explicit `return` statment and all return `None`. [robot-simulator](../exercise-concepts/robot-simulator.md) +- the knowledge of `return` statement could be a useful concept in this exercise [variable-length-quantity](../exercise-concepts/variable-length-quantity.md) +- "row" and "column" list values are expected from defined instance method(s) [matrix](../exercise-concepts/matrix.md) diff --git a/reference/concepts/rich_comparison_methods.md b/reference/concepts/rich_comparison_methods.md new file mode 100644 index 00000000..9886554e --- /dev/null +++ b/reference/concepts/rich_comparison_methods.md @@ -0,0 +1,5 @@ +# Rich comparison methods + +TODO: ADD MORE + +- The `__eq__` method is overloaded [clock](../exercise-concepts/clock.md) diff --git a/reference/concepts/set_comprehension.md b/reference/concepts/set_comprehension.md new file mode 100644 index 00000000..bff5cbf7 --- /dev/null +++ b/reference/concepts/set_comprehension.md @@ -0,0 +1,5 @@ +# Set comprehension + +Explain the use of `{i for i in iterable}` to create _sets_. + +TODO: ADD MORE diff --git a/reference/concepts/short_circuiting.md b/reference/concepts/short_circuiting.md new file mode 100644 index 00000000..bd81031a --- /dev/null +++ b/reference/concepts/short_circuiting.md @@ -0,0 +1,5 @@ +# Short circuiting + +TODO: ADD MORE + +- the exercise relies on short-circuiting to avoid unnecessary calculations [leap](../exercise-concepts/leap.md) diff --git a/reference/concepts/slicing.md b/reference/concepts/slicing.md new file mode 100644 index 00000000..dbfe4915 --- /dev/null +++ b/reference/concepts/slicing.md @@ -0,0 +1,7 @@ +# Slicing + +TODO: ADD MORE + +- the extended solution to this exercise can employ a slice (returns a copy) instead of calling `.copy()`. [matrix](../exercise-concepts/matrix.md) +- a slice within an iterable, i.e. the slice of items from `[x]` to `[y]`, can be accessed via `[x:y]` notation; a third parameter allows "skipping" by `z`, i.e. `stringname[x:y:z]` [phone-number](../exercise-concepts/phone-number.md) +- becase `str` in Python is a sequence type, [slicing](https://docs.python.org/3/reference/expressions.html#slicings) syntax can be used here. Specifically: for syntax `string[start:stop:stride]`: [reverse-string](../exercise-concepts/reverse-string.md) diff --git a/reference/concepts/standard_library.md b/reference/concepts/standard_library.md new file mode 100644 index 00000000..590aa08c --- /dev/null +++ b/reference/concepts/standard_library.md @@ -0,0 +1,5 @@ +# Standard library + +TODO: ADD MORE + +- the `re` module is an example of the Python stdlib (standard library), or included code libraries and tools that are frequently used in Python [phone-number](../exercise-concepts/phone-number.md) diff --git a/reference/concepts/star_args.md b/reference/concepts/star_args.md new file mode 100644 index 00000000..1d9ae0ee --- /dev/null +++ b/reference/concepts/star_args.md @@ -0,0 +1,3 @@ +# `*args` for variadic arguments + +TODO: Explain the use of ``*args` for collecting up an unknown number of positional arguments in function signatures. diff --git a/reference/concepts/star_star_kwargs.md b/reference/concepts/star_star_kwargs.md new file mode 100644 index 00000000..188f604b --- /dev/null +++ b/reference/concepts/star_star_kwargs.md @@ -0,0 +1,3 @@ +# `**kwargs` for variadic keyword arguments + +TODO: Explain the use of ``**kwargs` for collecting up a variable number of keyword arguments in function signatures. diff --git a/reference/concepts/static_methods.md b/reference/concepts/static_methods.md new file mode 100644 index 00000000..a2652d58 --- /dev/null +++ b/reference/concepts/static_methods.md @@ -0,0 +1,5 @@ +# Static methods + +TODO: ADD MORE + +- Distinct from built-in functions, instance methods, and class methods, these are methods that are bound to a class, rather than an instance, and called _without_ explicitly or implicitly passing in an object of the class. The example solution for this exercise uses the `static` `str` method `maketrans`. [rna-transcription](../exercise-concepts/rna-transcription.md) diff --git a/reference/concepts/string_formatting.md b/reference/concepts/string_formatting.md new file mode 100644 index 00000000..2569ab6b --- /dev/null +++ b/reference/concepts/string_formatting.md @@ -0,0 +1,5 @@ +# String formatting + +TODO: ADD MORE + +- How to format strings, ie `%` operator, `str.format`, f-strings [clock](../exercise-concepts/clock.md) diff --git a/reference/concepts/string_methods.md b/reference/concepts/string_methods.md new file mode 100644 index 00000000..f9ab7af6 --- /dev/null +++ b/reference/concepts/string_methods.md @@ -0,0 +1,6 @@ +# String methods + +TODO: ADD MORE + +- strings (and other types) have built in instance methods - in this case, `"string".startswith("s")` which are called from the instance of the string itself [phone-number](../exercise-concepts/phone-number.md) +- this exercise uses `str.maketrans()` (a static method of `str` that returns a dictionary to create a _translation table_ as required by the `str.translate()` instance method. This method is unusual in that it takes either a single dictionary or two strings of equal length. The example solution for this exercise uses `str.maketrans()` with a two-string argument. [rna-transcription](../exercise-concepts/rna-transcription.md) diff --git a/reference/concepts/string_splitting.md b/reference/concepts/string_splitting.md new file mode 100644 index 00000000..778ca9ad --- /dev/null +++ b/reference/concepts/string_splitting.md @@ -0,0 +1,6 @@ +# String splitting + +TODO: ADD MORE + +- The example solution uses `str.split()` to break the passed in markdown string into a list of lines broken up by the `\n` character. The alternate Python example solution uses `str.splitlines()` for the same effect across all line end characters. [markdown](../exercise-concepts/markdown.md) +- the example uses `str.split` with and without seperators to break the passed in string into "rows" and then "elements" [matrix](../exercise-concepts/matrix.md) diff --git a/reference/concepts/string_translation.md b/reference/concepts/string_translation.md new file mode 100644 index 00000000..2b0c5e9f --- /dev/null +++ b/reference/concepts/string_translation.md @@ -0,0 +1,5 @@ +# String translation + +TODO: ADD MORE + +- the `str.translate()` _instance method_ is called on an object from the `str` class (e.g. ``.translate()). Returns a copy of the inital string with each character re-mapped through the given _translation table_. The _translation table_ is typically a mapping or sequence type that implements indexing via the magic method `__getitem__()`. [rna-transcription](../exercise-concepts/rna-transcription.md) diff --git a/reference/concepts/tuple_unpacking.md b/reference/concepts/tuple_unpacking.md new file mode 100644 index 00000000..580a741c --- /dev/null +++ b/reference/concepts/tuple_unpacking.md @@ -0,0 +1,6 @@ +# Tuple unpacking + +TODO: ADD MORE + +- the values in an iterable can be unpacked into variables and used, i.e. `for a, b in zip(s1, s2)` [hamming](../exercise-concepts/hamming.md) +- iterating through a list of tuples, i.e. [(1, 2), (2,3)], each piece of each tuple can be unpacked into a separate variable (syntax: `a, b = (1, 2)`); this works for any sort of iterable (lists, for example, and even strings!) but is commonly used with tuples because they are typically of a known size/length, and so can be safely unpacked into N variables, with names. [hamming](../exercise-concepts/hamming.md) diff --git a/reference/concepts/type_conversion.md b/reference/concepts/type_conversion.md new file mode 100644 index 00000000..90c653a6 --- /dev/null +++ b/reference/concepts/type_conversion.md @@ -0,0 +1,5 @@ +# Type conversion + +TODO: ADD MORE + +- the passed in data is in `str` format but the output is expected as a list of type `int`. [matrix](../exercise-concepts/matrix.md) diff --git a/reference/concepts/type_hinting.md b/reference/concepts/type_hinting.md new file mode 100644 index 00000000..cc18920d --- /dev/null +++ b/reference/concepts/type_hinting.md @@ -0,0 +1,5 @@ +# Type hinting + +TODO: ADD MORE + +- In modern Python it's possibly to type hint annotations to parameters and variables, see [typing](https://docs.python.org/3/library/typing.html#module-typing). While not neccessary in Python such annotations can help your code be easier to read, understand, and check automatically using tools like `mypy`. [reverse-string](../exercise-concepts/reverse-string.md) diff --git a/reference/concepts/while_loops.md b/reference/concepts/while_loops.md new file mode 100644 index 00000000..987fe066 --- /dev/null +++ b/reference/concepts/while_loops.md @@ -0,0 +1,5 @@ +# While loops + +TODO: ADD MORE + +- the knowledge of `while` loops can be useful to solve this exercise [variable-length-quantity](../exercise-concepts/variable-length-quantity.md)