Open
Conversation
yangashley
reviewed
Oct 23, 2024
yangashley
left a comment
There was a problem hiding this comment.
Nice work! Waves 1 and 2 look good and the project directory is correctly organized.
You have some inconsistent white spacing and missed some indentations. Be mindful of this so that your code is polished and follows the PEP8 styleguide.
| self.name = name | ||
| self.description = description | ||
| self.distance_from_sun = distance_from_sun | ||
|
|
There was a problem hiding this comment.
How would you write the to_dict instance method so you can take an instance of Planet and turn it into a dictionary that will be returned as a response to a client's request?
| self.description = description | ||
| self.distance_from_sun = distance_from_sun | ||
|
|
||
| planets =[ |
There was a problem hiding this comment.
Suggested change
| planets =[ | |
| planets = [ |
Nit: missing whitespace after =
Comment on lines
+11
to
+17
| result_planets.append( | ||
| { | ||
| "id" : planet.id, | ||
| "name": planet.name, | ||
| "description" : planet.description, | ||
| "distance_from_sun" : planet.distance_from_sun | ||
| } |
There was a problem hiding this comment.
Inconsistent white spaces
Suggested change
| result_planets.append( | |
| { | |
| "id" : planet.id, | |
| "name": planet.name, | |
| "description" : planet.description, | |
| "distance_from_sun" : planet.distance_from_sun | |
| } | |
| result_planets.append( | |
| { | |
| "id": planet.id, | |
| "name": planet.name, | |
| "description": planet.description, | |
| "distance_from_sun": planet.distance_from_sun | |
| } |
Comment on lines
+40
to
+45
| return { | ||
| "id" : planet.id, | ||
| "name" : planet.name, | ||
| "description" : planet.description, | ||
| "distance_from_sun" : planet.distance_from_sun | ||
| } |
There was a problem hiding this comment.
Needs one more level of indentation
Suggested change
| return { | |
| "id" : planet.id, | |
| "name" : planet.name, | |
| "description" : planet.description, | |
| "distance_from_sun" : planet.distance_from_sun | |
| } | |
| return { | |
| "id" : planet.id, | |
| "name" : planet.name, | |
| "description" : planet.description, | |
| "distance_from_sun" : planet.distance_from_sun | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.