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

[python]challenge_[6](Pending) #225

Merged
merged 10 commits into from
Jan 7, 2017
Merged

Conversation

MJUIUC
Copy link
Contributor

@MJUIUC MJUIUC commented Jan 5, 2017

Here's my Solution for challenge 6.

import unittest
import time
from Solution import solution

Copy link
Collaborator

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):
Copy link
Collaborator

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:?

Copy link
Contributor Author

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):
Copy link
Collaborator

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.

Copy link
Contributor Author

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()
Copy link
Collaborator

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"
Copy link
Collaborator

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 " % "

Copy link
Contributor Author

@MJUIUC MJUIUC left a 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):
Copy link
Contributor Author

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):
Copy link
Contributor Author

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.

@MJUIUC MJUIUC changed the title [python]challenge_[6](UnReviewed) [python]challenge_[6](Pending) Jan 5, 2017
@MJUIUC MJUIUC merged commit b546368 into YearOfProgramming:master Jan 7, 2017
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.

None yet

2 participants