Skip to content

Commit 401ad37

Browse files
committed
Cleaned up formatting and refrences for matrix and kgg.
1 parent 223044e commit 401ad37

2 files changed

Lines changed: 25 additions & 11 deletions

File tree

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,27 @@
11
# Instructions append
22

3-
## Python Implementation
3+
## How this exercise is structured on the Python track
44

5-
The tests for this exercise expect your program to be implemented as a Garden `class` in Python.
6-
If you are unfamiliar with classes in Python, [classes][classes in python] from the Python docs is a good place to start.
5+
The tests for this exercise expect your program to be implemented as a Garden [`class`][classes in python] (_see also [concept:python/classes]()_).
6+
If you are unfamiliar with classes in Python, this [Real Python tutorial][how-to-make-a-class] could be a good additional place to start.
7+
8+
Your `class` should implement a [`method`][methods] called `plants`, which takes a student's name as an argument and returns the `list` of plant names belonging to that student.
79

8-
Your `class` should implement a `method` called plants, which takes a student's name as an argument and returns the `list` of plant names belonging to that student.
910

1011
## Constructors
1112

12-
Creating the example garden
13+
Creating the example garden:
1314

14-
```
15+
```python
1516
[window][window][window]
1617
VRCGVVRVCGGCCGVRGCVCGCGV
1718
VRCCCGCRRGVCGCRVVCVGCGCV
1819
```
1920

2021
would, in the tests, be represented as `Garden("VRCGVVRVCGGCCGVRGCVCGCGV\nVRCCCGCRRGVCGCRVVCVGCGCV")`.
2122

22-
To make this representation work, your `class` will need to implement an `__init__()` method.
23-
If you're not familiar with `__init__()` or _constructors_, [class and instance objects][class vs instance objects in python] from the Python docs gives a more detailed explanation.
23+
To make this representation work, your `class` will need to implement an [`__init__()`][init] [special method][special-methods].
24+
If you're not familiar with `__init__()` or [_constructors_][what-is-a-constructor], [class and instance objects][class vs instance objects in python] from the Python docs gives a more detailed explanation.
2425

2526

2627
## Default Parameters
@@ -29,6 +30,7 @@ In some tests, a `list` of students is passed as an argument to `__init__()`.
2930
This should override the twelve student roster provided in the problem statement.
3031
Both of these statements need to work with your `__init__()` method:
3132

33+
3234
```Python
3335
# Make a garden based on the default 12-student roster.
3436
Garden("VRCGVVRVCGGCCGVRGCVCGCGV\nVRCCCGCRRGVCGCRVVCVGCGCV")
@@ -37,11 +39,15 @@ Garden("VRCGVVRVCGGCCGVRGCVCGCGV\nVRCCCGCRRGVCGCRVVCVGCGCV")
3739
Garden("VRCC\nVCGG", students=["Valorie", "Raven"])
3840
```
3941

40-
4142
One approach is to make the student `list` a [default argument][default argument values]; the Python docs describe `default parameters` in depth while explaining [function definitions][function definitions].
4243

4344

44-
[classes in python]: https://docs.python.org/3/tutorial/classes.html
4545
[class vs instance objects in python]: https://docs.python.org/3/tutorial/classes.html#class-objects
46+
[classes in python]: https://docs.python.org/3/tutorial/classes.html#a-first-look-at-classes
4647
[default argument values]: https://docs.python.org/3/tutorial/controlflow.html#default-argument-values
4748
[function definitions]: https://docs.python.org/3/reference/compound_stmts.html#function-definitions
49+
[how-to-make-a-class]: https://realpython.com/python3-object-oriented-programming/#how-to-define-a-class-in-python
50+
[init]: https://docs.python.org/3/reference/datamodel.html#object.__init__
51+
[methods]: https://docs.python.org/3/tutorial/classes.html#class-definition-syntax
52+
[special-methods]: https://docs.python.org/3.11/reference/datamodel.html#special-method-names
53+
[what-is-a-constructor]: https://en.wikipedia.org/wiki/Constructor_(object-oriented_programming)
Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,15 @@
11
# Instructions append
22

3-
In this exercise you're going to create a **class**. _Don't worry, it's not as complicated as you think!_
3+
## How this exercise is structured on the Python track
4+
5+
The tests for this exercise expect you to create a Matrix [`class`][classes] (_see also [concept:python/classes]()_).
6+
This is different from _using_ a Matrix object from a third-party library such as [Numpy][numpy-matrix], which is not supported.
7+
_Don't worry, it's not as complicated as you think!_
8+
For more starting points and details on `classes` and data structures, take a look at the resources below:
9+
410

511
- [**A First Look at Classes**](https://docs.python.org/3/tutorial/classes.html#a-first-look-at-classes) from the Python 3 documentation.
612
- [**How to Define a Class in Python**](https://realpython.com/python3-object-oriented-programming/#how-to-define-a-class-in-python) from the Real Python website.
713
- [**Data Structures in Python**](https://docs.python.org/3/tutorial/datastructures.html) from the Python 3 documentation.
14+
15+
[numpy-matrix]: https://numpy.org/doc/stable/reference/generated/numpy.matrix.html

0 commit comments

Comments
 (0)