Skip to main content
Code Review

Return to Answer

replaced http://stackoverflow.com/ with https://stackoverflow.com/
Source Link

And the last style remark, in Python we have a if __name__ == "__main__" if __name__ == "__main__" guard, that ensures your code is only run when you call it via python script.py but not if you do from script import * in another script.

And the last style remark, in Python we have a if __name__ == "__main__" guard, that ensures your code is only run when you call it via python script.py but not if you do from script import * in another script.

And the last style remark, in Python we have a if __name__ == "__main__" guard, that ensures your code is only run when you call it via python script.py but not if you do from script import * in another script.

replaced http://codereview.stackexchange.com/ with https://codereview.stackexchange.com/
Source Link

Stephen did a good job in his answer his answer to make your functions more Pythonic. The only thing left to do now, is make them conform to the coding standards of Python. Python has an official style-guide, PEP8, which programmers are recommended to adhere to.

Stephen did a good job in his answer to make your functions more Pythonic. The only thing left to do now, is make them conform to the coding standards of Python. Python has an official style-guide, PEP8, which programmers are recommended to adhere to.

Stephen did a good job in his answer to make your functions more Pythonic. The only thing left to do now, is make them conform to the coding standards of Python. Python has an official style-guide, PEP8, which programmers are recommended to adhere to.

deleted 2 characters in body
Source Link
Graipher
  • 41.6k
  • 7
  • 70
  • 134

In addition to that, Python also has a convention for docstrings, which explain what a function does. The convention is set in PEP498 PEP257 and looks like this:

In addition to that, Python also has a convention for docstrings, which explain what a function does. The convention is set in PEP498 and looks like this:

In addition to that, Python also has a convention for docstrings, which explain what a function does. The convention is set in PEP257 and looks like this:

Source Link
Graipher
  • 41.6k
  • 7
  • 70
  • 134
Loading
lang-py

AltStyle によって変換されたページ (->オリジナル) /