33
Last seen 6 days ago
Member for 9 years, 11 months, 1 day
Difficulty Normal
This is clever. One nit - I would make MAX_TIME a class constant in the MicrowaveBase class.
More
Appreciate the code comments, but note that docstrings should be enclosed by double quotes versus single quotes (no space between the quotes and text) and should begin with a one-line summary line. Per PEP257:
> Multi-line docstrings consist of a summary line just like a one-line docstring, foll
More
It's nice to see comments in the code, which means you care about the code, care about the ability for others to understand the code, and that you hope the comments help in maintaining the code.
As a suggestion, you might want to look at the PEP8 and PEP256 (https://www.python.org/dev/peps/pep-02
More
Beautiful. For symmetry you could put parens around the (a1_speed * advantage), but the precedence ensures it works as is.
More
Your comment on my solution for this problem referenced your own, so I thought I'd take a look at your solution. As you said, the logic behind our solutions is indeed similar. If, as you also say, that my code appears cleaner, it could be because it's not manipulating indices; index manipulation i
More
This looks like an annotated version of fnmatch's translate(). While it's nice to see that code commented, is it really fair to copy that logic?
More
Nice. A proper docstring, use of Counter and meaningful variable names.
More
I don't normally pick on people's code, but this is for Quest points and my intention is to be helpful. Your name has 'newbie' in it, so I chose your submission as I thought you might want/need the feedback:
1. To improve your chances of getting 'like' points for a solution, make sure you clean up
More
Concise, but readable, which is a nice balance. I also like the use of the '-item'. Suggestions:
1. Remove the "if __name__" code so only your solution is present. It allows people to focus on your code and removes the distraction.
2. Add a docstring to your function for a little PEP polish.
3
More
Some suggestions:
To improve your chances of getting ‘like’ points for a solution, make sure you clean up the comments such as "your code here" or comments that are no longer relevant.
Remove the “if name == 'main':” section as that allows people to focus on your code and let it shine.
Take a l
More
You probably just missed this, but you've initialized the 'list' array twice, lines 3 and 6. I believe the initialization on line 3 could be removed.
Also, you could eliminate the variable 'temp' and just use 'line[count:]' directly in line 7.
More
For clarity, you might want to remove commented code. Also, PEP8 suggests:
> If operators with different priorities are used, consider adding whitespace around the operators with the lowest priority(ies). Use your own judgment; however, never use more than one space, and always have the same amoun
More
Just a suggestion for your 'return' statement, per PEP8:
> If operators with different priorities are used, consider adding whitespace around the operators with the lowest priority(ies). Use your own judgment; however, never use more than one space, and always have the same amount of whitespace on
More
I'm responding to your comment on my code:
I dislike my show_dialogue() method due to the fact that it uses an 'if' statement to detect the type of text, but the problem description suggested the use of the Mediator pattern and that's how I 'patterned' my approach. I'm sure there's a better way an
More
Nice concise solution, but may I suggest a review of the PEP8 guidelines for standard indentation and spacing (https://www.python.org/dev/peps/pep-0008/#indentation) to give your code a final polish?
More
If you're going to use short variable names (contrary to the PEP-8 standards), please add comments to aid in the understanding of your logic.
More
The output needs to be a float, but the specification for the problem does not specify the number of decimal digits required.
More