-
Notifications
You must be signed in to change notification settings - Fork 162
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
[python]challenge_[6](Pending) #225
Conversation
import unittest | ||
import time | ||
from Solution import solution | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this much whitespace typical in Python? I would assume 1 newline would suffice. Thoughts on removing the extra newlines.
@@ -0,0 +1,28 @@ | |||
# Writing solution for this range problem | |||
|
|||
class solution(object): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can this just be class Solution:
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suppose, but I don't think that's a big deal.
# Writing solution for this range problem | ||
|
||
class solution(object): | ||
def compRange(self,nums): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe the PEP 8 styleguide wants a space after commas.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn't know what PEP was until I read this comment.
|
||
|
||
if __name__ == '__main__': | ||
unittest.main() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing newline.
t1 = time.time() | ||
out = case1.compRange(tlist) | ||
t2 = time.time() | ||
print "Runtime for case1: " + str(t2-t1) + " seconds" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe the pep 8 styleguide implies that spaces should go around all binary operators like " - " and " % "
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well I know what PEP is now!
# Writing solution for this range problem | ||
|
||
class solution(object): | ||
def compRange(self,nums): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn't know what PEP was until I read this comment.
@@ -0,0 +1,28 @@ | |||
# Writing solution for this range problem | |||
|
|||
class solution(object): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suppose, but I don't think that's a big deal.
Here's my Solution for challenge 6.