Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update final-exercise.md #149

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ class GitHubApiException(Exception):

### `models.py`

Next, let's build our "model", the `GitHubRepo` class. For this, we want to accept three arguments (`name`, `language`, and `num_stars`) and store them as instance variables (using `self`). To have a user-friend way to print our repo information, add a `__str__()` method that prints a message with the three repo parameters. For completeness, see if you can add a `__repr__()` method that returns the Python code needed to recreate this object.
Next, let's build our "model", the `GitHubRepo` class. For this, we want to accept three arguments (`name`, `language`, and `num_stars`) and store them as instance variables (using `self`). To have a user-friendly way to print our repo information, add a `__str__()` method that prints a message with the three repo parameters. For completeness, see if you can add a `__repr__()` method that returns the Python code needed to recreate this object.

{{%expand "You should have something like this:" %}}

Expand Down