Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .github/ISSUE_TEMPLATE/new_concept_exercise_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,9 +91,9 @@ This concept exercise is meant to teach an understanding/use of`<concept-SLUG>`.



*
*
*
*
*
*



Expand All @@ -108,7 +108,7 @@ This concept exercise is meant to teach an understanding/use of`<concept-SLUG>`.
* ### `links.json`

* The same resources can be used for the [ `concepts/links.json`](https://github.com/exercism/docs/blob/main/anatomy/tracks/concepts.md#file-linksjson) file, if it doesn't already exist.
* If there are particularly good/interesting informations sources for this concept that extend or supplement the concept exercise material, please add them to the `links.json` document.
* If there are particularly good/interesting information sources for this concept that extend or supplement the concept exercise material, please add them to the `links.json` document.



Expand Down
26 changes: 13 additions & 13 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,19 +17,19 @@ Hi. &nbsp;👋🏽 &nbsp;👋 &nbsp;**We are happy you are here.**&nbsp; 🎉&nb
<br>
<img align="left" width="90" height="85" src="https://github.com/exercism/website-icons/blob/main/exercises/health-statistics.svg">

We&nbsp;💛&nbsp;💙 &nbsp; our community.
**`But our maintainers are not accepting community contributions at this time.`**
We&nbsp;💛&nbsp;💙 &nbsp; our community.
**`But our maintainers are not accepting community contributions at this time.`**
Please read this [community blog post](https://exercism.org/blog/freeing-our-maintainers) for details.

</tr>
</table>
<br>

**`exercism/Python`** is one of many programming language tracks on [exercism(dot)org][exercism-website].
**`exercism/Python`** is one of many programming language tracks on [exercism(dot)org][exercism-website].
This repo holds all the instructions, tests, code, & support files for Python _exercises_ currently under development or implemented & available for students.

🌟 &nbsp;&nbsp;Track exercises support Python `3.7` - `3.11.2`.
Exceptions to this support are noted where they occur.
Exceptions to this support are noted where they occur.
🌟 &nbsp;&nbsp;Track tooling (_test-runner, representer, analyzer, and Continuous Integration_) runs on Python `3.11.2`.

Exercises are grouped into **concept** exercises which teach the [Python syllabus][python-syllabus], and **practice** exercises, which are unlocked by progressing in the syllabus tree &nbsp;🌴&nbsp;.
Expand All @@ -42,17 +42,17 @@ Practice exercises are open-ended, and can be used to practice concepts learned,

It is not uncommon to discover typos, confusing directions, or incorrect implementations of certain tests or code examples. Or you might have a great suggestion for a hint to aid students (&nbsp;💙 &nbsp;), see optimizations for exemplar or test code, find missing test cases to add, or want to correct factual and/or logical errors. Or maybe you have a great idea 💡 for an exercise or feature (&nbsp;💙&nbsp;).

_Our track is always a work in progress!_ 🌟🌟
_Our track is always a work in progress!_ 🌟🌟
While contributions are paused, we ask that you [`open a thread in our community forum`](https://forum.exercism.org) to let us know what you have found/suggest.

<br>

## 🚧 **Did you write a patch that fixes a bug?**

**`Our maintainers are not accepting community contributions at this time.`**
**`Our maintainers are not accepting community contributions at this time.`**
Please read this [community blog post](https://exercism.org/blog/freeing-our-maintainers) for details.

Once the pause ends, we will **happily** consider your PR.
Once the pause ends, we will **happily** consider your PR.
Until that time, all PRs from the larger community will be **automatically closed** with a note.

We're leaving the general contributing docs below for our long-term collaborators and maintainers.
Expand Down Expand Up @@ -111,7 +111,7 @@ Our documents use [Markdown][markdown-language], with certain [alterations][exer

<br>
<img align="left" width="70" height="65" src="https://github.com/exercism/website-icons/blob/main/tracks/python.svg">
<p vertical-align="middle"><h2 id="coding-standars">Coding Standards</h2></p>
<p vertical-align="middle"><h2 id="coding-standards">Coding Standards</h2></p>

<br>

Expand Down Expand Up @@ -185,7 +185,7 @@ Our documents use [Markdown][markdown-language], with certain [alterations][exer

If you have any questions or issues, don't hesitate to ask the maintainers -- they're always happy to help&nbsp;💛&nbsp;💙&nbsp;

Some of our code is old and does not (yet) conform to all these standards.
Some of our code is old and does not (yet) conform to all these standards.
_We know it, and trust us, we are working on fixing it._ But if you see &nbsp;👀&nbsp; something, &nbsp;👄&nbsp; say something. It'll motivate us to fix it! 🌈

<br>
Expand All @@ -195,7 +195,7 @@ _We know it, and trust us, we are working on fixing it._ But if you see &nbsp;

<br>

This track officially supports Python `3.7 - 3.11.2` for students completing exercises.
This track officially supports Python `3.7 - 3.11.2` for students completing exercises.
The track `test runner`, `analyzer`, and `representer` run in docker on `python:3.11.2-slim`.

Although the majority of test cases are written using `unittest.TestCase`,
Expand Down Expand Up @@ -316,7 +316,7 @@ _Exercise Structure with Auto-Generated Test Files_

<br>

Practice exercise `<exercise_slug>_test.py` files are generated/regenerated via the [Python Track Test Generator][python-track-test-generator].
Practice exercise `<exercise_slug>_test.py` files are generated/regenerated via the [Python Track Test Generator][python-track-test-generator].
Please reach out to a maintainer if you need any help with the process.

<br>
Expand All @@ -338,7 +338,7 @@ If an unimplemented exercise does not have a `canonical-data.json` file, the tes
1. Verification of the tests
2. Example implementation for mentor/student reference

Unlike `concept` exercise, practice exercise `example.py` files are **NOT** intended as as a "best practice" or "standard".
Unlike `concept` exercise, practice exercise `example.py` files are **NOT** intended as as a "best practice" or "standard".
They are provided as proof that there is an acceptable and testable answer to the practice exercise.

<br>
Expand All @@ -354,7 +354,7 @@ Implementing Track-specific Practice Exercises is similar to implementing a `can
<br>
<b>You will need</b>

1.&nbsp;&nbsp;A local clone of the [problem-specifications] repository.
1.&nbsp;&nbsp;A local clone of the [problem-specifications] repository.
2.&nbsp;&nbsp;[configlet]

<p><b>For Individual Exercises</b><p><img id="regenerating-individual-exercise-documents" align="left" width="45" height="45" src="https://github.com/exercism/website-icons/blob/main/exercises/doubly-linked-list.svg"></p>
Expand Down
16 changes: 8 additions & 8 deletions concepts/basics/about.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

Python is a [dynamic and strongly typed][dynamic typing in python] programming language.
It employs both [duck typing][duck typing] and [gradual typing][gradual typing], via [type hints][type hints].
Imperative, declarative (e.g., functional), and object-oriented programming _styles_ are all supported, but internally **[everything in Python is an object][everythings an object]**.
Imperative, declarative (e.g., functional), and object-oriented programming _styles_ are all supported, but internally **[everything in Python is an object][everything is an object]**.

Python puts a strong emphasis on code readability and (_similar to Haskell_) uses [significant indentation][significant indentation] to denote function, method, and class definitions.

Expand Down Expand Up @@ -116,7 +116,7 @@ Statements for the _body_ of the function begin on the line following `def` and
# The body of a function is indented by 2 spaces, & prints the sum of the numbers.
def add_two_numbers(number_one, number_two):
total = number_one + number_two
print(total)
print(total)

>>> add_two_numbers(3, 4)
7
Expand All @@ -141,14 +141,14 @@ Functions _explicitly_ return a value or object via the [`return`][return] keywo
```python
# Function definition on first line, explicit return used on final line.
def add_two_numbers(number_one, number_two):
return number_one + number_two
return number_one + number_two


# Calling the function in the Python terminal returns the sum of the numbers.
>>> add_two_numbers(3, 4)
7

# Assigning the function call to a variable and printing
# Assigning the function call to a variable and printing
# the variable will also return the value.
>>> sum_with_return = add_two_numbers(5, 6)
>>> print(sum_with_return)
Expand All @@ -166,19 +166,19 @@ def add_two_numbers(number_one, number_two):
result = number_one + number_two


# Calling the function in the Python terminal appears
# Calling the function in the Python terminal appears
# to not return anything at all.
>>> add_two_numbers(5, 7)
>>>


# Using print() with the function call shows that
# Using print() with the function call shows that
# the function is actually returning the **None** object.
>>> print(add_two_numbers(5, 7))
None


# Assigning the function call to a variable and printing
# Assigning the function call to a variable and printing
# the variable will also show None.
>>> sum_without_return = add_two_numbers(5, 6)
>>> print(sum_without_return)
Expand Down Expand Up @@ -320,7 +320,7 @@ errors defaults to 'strict'.
[doctests]: https://docs.python.org/3/library/doctest.html
[duck typing]: https://en.wikipedia.org/wiki/Duck_typing
[dynamic typing in python]: https://stackoverflow.com/questions/11328920/is-python-strongly-typed
[everythings an object]: https://docs.python.org/3/reference/datamodel.html
[everything is an object]: https://docs.python.org/3/reference/datamodel.html
[facts-and-myths-about-python-names]: https://nedbatchelder.com/text/names.html
[function definition]: https://docs.python.org/3/tutorial/controlflow.html#defining-functions
[functions]: https://docs.python.org/3/reference/compound_stmts.html#function
Expand Down
16 changes: 8 additions & 8 deletions concepts/basics/introduction.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Python puts a strong emphasis on code readability and (_similar to Haskell_) use

Python was created by Guido van Rossum and first released in 1991.

Imperative, declarative (e.g., functional), and object-oriented programming _styles_ are all supported, but internally **[everything in Python is an object][everythings an object]**.
Imperative, declarative (e.g., functional), and object-oriented programming _styles_ are all supported, but internally **[everything in Python is an object][everything is an object]**.

We'll dig more into what all of that means as we continue through the Python track concepts.

Expand Down Expand Up @@ -62,7 +62,7 @@ Statements for the _body_ of the function begin on the line following `def` and
# The body of this function is indented by 2 spaces,& prints the sum of the numbers.
def add_two_numbers(number_one, number_two):
total = number_one + number_two
print(total)
print(total)

>>> add_two_numbers(3, 4)
7
Expand All @@ -87,14 +87,14 @@ Functions _explicitly_ return a value or object via the [`return`][return] keywo
```python
# Function definition on first line, explicit return used on final line.
def add_two_numbers(number_one, number_two):
return number_one + number_two
return number_one + number_two


# Calling the function in the Python terminal returns the sum of the numbers.
>>> add_two_numbers(3, 4)
7

# Assigning the function call to a variable and printing
# Assigning the function call to a variable and printing
# the variable will also return the value.
>>> sum_with_return = add_two_numbers(5, 6)
>>> print(sum_with_return)
Expand All @@ -114,19 +114,19 @@ def add_two_numbers(number_one, number_two):
result = number_one + number_two


# Calling the function in the Python terminal appears
# Calling the function in the Python terminal appears
# to not return anything at all.
>>> add_two_numbers(5, 7)
>>>


# Using print() with the function call shows that
# Using print() with the function call shows that
# the function is actually returning the **None** object.
>>> print(add_two_numbers(5, 7))
None


# Assigning the function call to a variable and printing
# Assigning the function call to a variable and printing
# the variable will also show None.
>>> sum_without_return = add_two_numbers(5, 6)
>>> print(sum_without_return)
Expand Down Expand Up @@ -169,7 +169,7 @@ def complex(real=0.0, imag=0.0):
[docstring]: https://docs.python.org/3/tutorial/controlflow.html#tut-docstrings
[duck typing]: https://en.wikipedia.org/wiki/Duck_typing
[dynamic typing in python]: https://stackoverflow.com/questions/11328920/is-python-strongly-typed
[everythings an object]: https://docs.python.org/3/reference/datamodel.html
[everything is an object]: https://docs.python.org/3/reference/datamodel.html
[facts-and-myths-about-python-names]: https://nedbatchelder.com/text/names.html
[function definition]: https://docs.python.org/3/tutorial/controlflow.html#defining-functions
[gradual typing]: https://en.wikipedia.org/wiki/Gradual_typing
Expand Down
16 changes: 8 additions & 8 deletions concepts/bitwise-operators/about.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,17 +28,17 @@ There are multiple ways to convert integers to binary strings, varying in whethe
23

# Converting an int display to binary string, with prefix.
>>> bin(23)
>>> bin(23)
'0b10111'

>>> number = 23

# Binary without prefix, padded to 8 digits.
>>> format(number, '08b')
>>> format(number, '08b')
'00010111'

# Same format, but using an f-string.
>>> f"{number} in decimal is {number:08b} in binary and {number:x} in hex"
>>> f"{number} in decimal is {number:08b} in binary and {number:x} in hex"
'23 in decimal is 00010111 in binary and 17 in hex'
```

Expand Down Expand Up @@ -117,7 +117,7 @@ This means that all bits are inverted and a number is _**interpreted as negative
Positive numbers have an MSB of `0`.
This representation has the advantage of only having one version of zero, so that the programmer doesn't have to manage `-0` and `+0`.

This way of representing negative and positive numbers adds a complication for Python: there are no finite-integer concepts like `int32` or `int64` internally in the core langauge.
This way of representing negative and positive numbers adds a complication for Python: there are no finite-integer concepts like `int32` or `int64` internally in the core language.
In 'modern' Python, `int`s are of unlimited size (_limited only by hardware capacity_), and a negative or bit-inverted number has a (_theoretically_) infinite number of `1`'s to the left, just as a positive number has unlimited `0`'s.

This makes it difficult to give a useful example of `bitwise not`:
Expand All @@ -129,7 +129,7 @@ This makes it difficult to give a useful example of `bitwise not`:

# This is a negative binary (not twos-complement display).
>>> format(~x, '08b')
'-1100111'
'-1100111'

# Decimal representation.
>>> x
Expand Down Expand Up @@ -167,14 +167,14 @@ Keep in mind the previous section on negative numbers and their pitfalls when sh
>>> format(x, '08b')
'00001000'

# A left bit shift.
>>> x << 2
# A left bit shift.
>>> x << 2
32

>>> format(x << 2, '08b')
'00100000'

# A right bit shift.
# A right bit shift.
>>> format(x >> 2, '08b')
'00000010'
```
Expand Down
2 changes: 1 addition & 1 deletion concepts/classes/about.md
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ class MyClass:
def __init__(self, location):

# This is an instance or object property, attribute, or variable.
# Note that we are unpacking the tuple argument into two seperate instance variables.
# Note that we are unpacking the tuple argument into two separate instance variables.
self.location_x = location[0]
self.location_y = location[1]

Expand Down
4 changes: 2 additions & 2 deletions docs/ABOUT.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
[Python][python docs] is a [dynamic and strongly][dynamic typing in python] typed [object-oriented][object oriented programming] programming language.
It employs both [duck typing][duck typing] and [gradual typing][gradual typing] (via [type hints][type hints]).
It supports multiple programming paradigms including imperative (_object-oriented, procedural_) and declarative (_functional, concurrent_) flavors.
But do not be fooled: while programming across paradigms is fully supported, [everything in Python is an object][everythings an object].
But do not be fooled: while programming across paradigms is fully supported, [everything in Python is an object][everything is an object].


Python was created by Guido van Rossum and first released in 1991.
Expand Down Expand Up @@ -42,7 +42,7 @@ Complete documentation for the current release of Python (3.11.x) can be found a
[duck typing]: https://en.wikipedia.org/wiki/Duck_typing
[dynamic typing in python]: https://stackoverflow.com/questions/11328920/is-python-strongly-typed
[editors for python]: https://djangostars.com/blog/python-ide/
[everythings an object]: https://docs.python.org/3/reference/datamodel.html
[everything is an object]: https://docs.python.org/3/reference/datamodel.html
[gradual typing]: https://en.wikipedia.org/wiki/Gradual_typing
[jupyter]: http://jupyter.org
[object oriented programming]: https://en.wikipedia.org/wiki/Object-oriented_programming
Expand Down
Loading