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
This commit is contained in:
Michael Morehouse
2020-03-05 20:46:17 +00:00
committed by Corey McCandless
parent d7231f45b7
commit 29478dd68c
206 changed files with 1442 additions and 0 deletions

View File

@@ -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)

View File

@@ -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)

View File

@@ -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)

View File

@@ -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)

View File

@@ -0,0 +1,5 @@
# Bitflags
TODO: ADD MORE
- a general understanding of bitflags is required to solve this exercise [allergies](../exercise-concepts/allergies.md)

View File

@@ -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)

View File

@@ -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)

View File

@@ -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)

View File

@@ -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)

View File

@@ -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)

View File

@@ -0,0 +1,7 @@
# `__import__`
TODO: ADD MORE DETAIL
See [docs][docs].
[docs]: https://docs.python.org/3/library/functions.html#__import__

View File

@@ -0,0 +1,7 @@
# `abs`
TODO: ADD MORE DETAIL
See [docs][docs].
[docs]: https://docs.python.org/3/library/functions.html#abs

View File

@@ -0,0 +1,7 @@
# `all`
TODO: ADD MORE DETAIL
See [docs][docs].
[docs]: https://docs.python.org/3/library/functions.html#all

View File

@@ -0,0 +1,7 @@
# `any`
TODO: ADD MORE DETAIL
See [docs][docs].
[docs]: https://docs.python.org/3/library/functions.html#any

View File

@@ -0,0 +1,7 @@
# `ascii`
TODO: ADD MORE DETAIL
See [docs][docs].
[docs]: https://docs.python.org/3/library/functions.html#ascii

View File

@@ -0,0 +1,7 @@
# `bin`
TODO: ADD MORE DETAIL
See [docs][docs].
[docs]: https://docs.python.org/3/library/functions.html#bin

View File

@@ -0,0 +1,7 @@
# `breakpoint`
TODO: ADD MORE DETAIL
See [docs][docs].
[docs]: https://docs.python.org/3/library/functions.html#breakpoint

View File

@@ -0,0 +1,7 @@
# `callable`
TODO: ADD MORE DETAIL
See [docs][docs].
[docs]: https://docs.python.org/3/library/functions.html#callable

View File

@@ -0,0 +1,7 @@
# `chr`
TODO: ADD MORE DETAIL
See [docs][docs].
[docs]: https://docs.python.org/3/library/functions.html#chr

View File

@@ -0,0 +1,7 @@
# `classmethod`
TODO: ADD MORE DETAIL
See [docs][docs].
[docs]: https://docs.python.org/3/library/functions.html#classmethod

View File

@@ -0,0 +1,7 @@
# `compile`
TODO: ADD MORE DETAIL
See [docs][docs].
[docs]: https://docs.python.org/3/library/functions.html#compile

View File

@@ -0,0 +1,7 @@
# `delattr`
TODO: ADD MORE DETAIL
See [docs][docs].
[docs]: https://docs.python.org/3/library/functions.html#delattr

View File

@@ -0,0 +1,7 @@
# `dir`
TODO: ADD MORE DETAIL
See [docs][docs].
[docs]: https://docs.python.org/3/library/functions.html#dir

View File

@@ -0,0 +1,7 @@
# `divmod`
TODO: ADD MORE DETAIL
See [docs][docs].
[docs]: https://docs.python.org/3/library/functions.html#divmod

View File

@@ -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

View File

@@ -0,0 +1,7 @@
# `eval`
TODO: ADD MORE DETAIL
See [docs][docs].
[docs]: https://docs.python.org/3/library/functions.html#eval

View File

@@ -0,0 +1,7 @@
# `exec`
TODO: ADD MORE DETAIL
See [docs][docs].
[docs]: https://docs.python.org/3/library/functions.html#exec

View File

@@ -0,0 +1,7 @@
# `filter`
TODO: ADD MORE DETAIL
See [docs][docs].
[docs]: https://docs.python.org/3/library/functions.html#filter

View File

@@ -0,0 +1,7 @@
# `format`
TODO: ADD MORE DETAIL
See [docs][docs].
[docs]: https://docs.python.org/3/library/functions.html#format

View File

@@ -0,0 +1,7 @@
# `getattr`
TODO: ADD MORE DETAIL
See [docs][docs].
[docs]: https://docs.python.org/3/library/functions.html#getattr

View File

@@ -0,0 +1,7 @@
# `globals`
TODO: ADD MORE DETAIL
See [docs][docs].
[docs]: https://docs.python.org/3/library/functions.html#globals

View File

@@ -0,0 +1,7 @@
# `hasattr`
TODO: ADD MORE DETAIL
See [docs][docs].
[docs]: https://docs.python.org/3/library/functions.html#hasattr

View File

@@ -0,0 +1,7 @@
# `hash`
TODO: ADD MORE DETAIL
See [docs][docs].
[docs]: https://docs.python.org/3/library/functions.html#hash

View File

@@ -0,0 +1,7 @@
# `help`
TODO: ADD MORE DETAIL
See [docs][docs].
[docs]: https://docs.python.org/3/library/functions.html#help

View File

@@ -0,0 +1,7 @@
# `hex`
TODO: ADD MORE DETAIL
See [docs][docs].
[docs]: https://docs.python.org/3/library/functions.html#hex

View File

@@ -0,0 +1,7 @@
# `id`
TODO: ADD MORE DETAIL
See [docs][docs].
[docs]: https://docs.python.org/3/library/functions.html#id

View File

@@ -0,0 +1,7 @@
# `input`
TODO: ADD MORE DETAIL
See [docs][docs].
[docs]: https://docs.python.org/3/library/functions.html#input

View File

@@ -0,0 +1,7 @@
# `isinstance`
TODO: ADD MORE DETAIL
See [docs][docs].
[docs]: https://docs.python.org/3/library/functions.html#isinstance

View File

@@ -0,0 +1,7 @@
# `issubclass`
TODO: ADD MORE DETAIL
See [docs][docs].
[docs]: https://docs.python.org/3/library/functions.html#issubclass

View File

@@ -0,0 +1,7 @@
# `iter`
TODO: ADD MORE DETAIL
See [docs][docs].
[docs]: https://docs.python.org/3/library/functions.html#iter

View File

@@ -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

View File

@@ -0,0 +1,7 @@
# `locals`
TODO: ADD MORE DETAIL
See [docs][docs].
[docs]: https://docs.python.org/3/library/functions.html#locals

View File

@@ -0,0 +1,7 @@
# `map`
TODO: ADD MORE DETAIL
See [docs][docs].
[docs]: https://docs.python.org/3/library/functions.html#map

View File

@@ -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

View File

@@ -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

View File

@@ -0,0 +1,7 @@
# `next`
TODO: ADD MORE DETAIL
See [docs][docs].
[docs]: https://docs.python.org/3/library/functions.html#next

View File

@@ -0,0 +1,7 @@
# `oct`
TODO: ADD MORE DETAIL
See [docs][docs].
[docs]: https://docs.python.org/3/library/functions.html#oct

View File

@@ -0,0 +1,7 @@
# `open`
TODO: ADD MORE DETAIL
See [docs][docs].
[docs]: https://docs.python.org/3/library/functions.html#open

View File

@@ -0,0 +1,7 @@
# `ord`
TODO: ADD MORE DETAIL
See [docs][docs].
[docs]: https://docs.python.org/3/library/functions.html#ord

View File

@@ -0,0 +1,7 @@
# `pow`
TODO: ADD MORE DETAIL
See [docs][docs].
[docs]: https://docs.python.org/3/library/functions.html#pow

View File

@@ -0,0 +1,7 @@
# `print`
TODO: ADD MORE DETAIL
See [docs][docs].
[docs]: https://docs.python.org/3/library/functions.html#print

View File

@@ -0,0 +1,7 @@
# `repr`
TODO: ADD MORE DETAIL
See [docs][docs].
[docs]: https://docs.python.org/3/library/functions.html#repr

View File

@@ -0,0 +1,7 @@
# `reversed`
TODO: ADD MORE DETAIL
See [docs][docs].
[docs]: https://docs.python.org/3/library/functions.html#reversed

View File

@@ -0,0 +1,7 @@
# `round`
TODO: ADD MORE DETAIL
See [docs][docs].
[docs]: https://docs.python.org/3/library/functions.html#round

View File

@@ -0,0 +1,7 @@
# `setattr`
TODO: ADD MORE DETAIL
See [docs][docs].
[docs]: https://docs.python.org/3/library/functions.html#setattr

View File

@@ -0,0 +1,7 @@
# `sorted`
TODO: ADD MORE DETAIL
See [docs][docs].
[docs]: https://docs.python.org/3/library/functions.html#sorted

View File

@@ -0,0 +1,7 @@
# `staticmethod`
TODO: ADD MORE DETAIL
See [docs][docs].
[docs]: https://docs.python.org/3/library/functions.html#staticmethod

View File

@@ -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

View File

@@ -0,0 +1,7 @@
# `super`
TODO: ADD MORE DETAIL
See [docs][docs].
[docs]: https://docs.python.org/3/library/functions.html#super

View File

@@ -0,0 +1,7 @@
# `vars`
TODO: ADD MORE DETAIL
See [docs][docs].
[docs]: https://docs.python.org/3/library/functions.html#vars

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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)

View File

@@ -0,0 +1,3 @@
# Class attributes
TODO: ADD MORE

View File

@@ -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)

View File

@@ -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)

View File

@@ -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)

View File

@@ -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)

View File

@@ -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)

View File

@@ -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)

View File

@@ -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)

View File

@@ -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)

View File

@@ -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)

View File

@@ -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 <ClassName>:` 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)

View File

@@ -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)

View File

@@ -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)

View File

@@ -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)

View File

@@ -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)

View File

@@ -0,0 +1,5 @@
# Dictionary comprehension
Explain the use of `{k: v for k,v in iterable}` to create _dictionaries_.
TODO: ADD MORE

View File

@@ -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)

View File

@@ -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)

View File

@@ -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)

View File

@@ -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.

Some files were not shown because too many files have changed in this diff Show More