Skip to content

code review request#13

Open
Mayongjin1404 wants to merge 7 commits into
CP1404:masterfrom
Mayongjin1404:master
Open

code review request#13
Mayongjin1404 wants to merge 7 commits into
CP1404:masterfrom
Mayongjin1404:master

Conversation

@Mayongjin1404

Copy link
Copy Markdown

@jc463272 Could you please review my practical 6 code? Thanks!

@Mayongjin1404 Mayongjin1404 changed the title finished Prac 6 code review request Jul 10, 2025
@jc463272

Copy link
Copy Markdown

Hi @Mayongjin1404, I think you have sent this to the wrong person. For practical 06, you need to send it to "@haydenw98" so they can review your code? The link to the mentions list is provided below for future reference:

https://github.com/CP1404/Starter/wiki/Code-Review-Order#prac-7

@Mayongjin1404 Mayongjin1404 changed the title Prac 6 code review request code review request Jul 18, 2025
@Mayongjin1404

Copy link
Copy Markdown
Author

@haydenw98 Could you please review my practical 7 code? Thanks!

@haydenw98 haydenw98 left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just finished reviewing your code, though it's clear you're ahead of me when it comes to python as I am unfamiliar with some of your conventions. Great work!

Comment thread prac_06/used_cars.py
limo.add_fuel(20)
print(f"Limo fuel: {limo.fuel}")
limo.drive(115)
print(limo)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very tidy work, not much to critique here!

Comment thread prac_06/languages.py
"""

from prac_06.programming_language import ProgrammingLanguage

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work, although putting inside a main() with docstrings might help with readability

self.year = year

def is_dynamic(self) -> bool:
return self.typing.lower() == "dynamic"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great thinking with .lower though not sure how necessary it is.

Comment thread prac_06/guitars.py
f"worth ${guitar.cost:10,.2f}{vintage_tag}")


def _read_int(prompt: str) -> int:

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hadn't seen this function naming standard before (marking private by starting with an _) so had to read up on it. May be a little restrictive or unnecessary for the program as it is defined and used in the same script?

Comment thread prac_06/guitars.py
raise ValueError
return value
except ValueError:
print("Input must be a non-negative number")

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great error checking! My script missed this.

Comment thread prac_06/guitar.py
def is_vintage(self) -> bool:
return self.get_age() >= 50

def __str__(self) -> str:

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These could use some docstrings

Comment thread prac_06/guitar.py
return CURRENT_YEAR - self.year

def is_vintage(self) -> bool:
return self.get_age() >= 50

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I too used 50 here, but maybe a constant or variable would make 50 feel less like a magic number

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants