Skip to main content
Code Review

Return to Answer

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

I guess you might have heard of PEP8, which is the style guideline for Python. Contrary to a lot of other programming languages, this style guideline is actually used a lot, and is the main standard for coding in Python.

Your code looks clean, and I like that you've commented using docstrings moth the module/file and the function. Mast does have a point that you can accomplish the same using message[::-1], but part of going into a new language is learning what the language can offer in standard libraries.

Do look into using slice'ing, which is extremely powerful and useful. A challenge for you is to resolve Project Euler #13: Large sum Project Euler #13: Large sum using Python and sliceing. I think you'll get some pleasant surprises related to string vs number handling, and handling of large numbers as well.

Two other comments related to style issues:

  • Use snake_case for variable and function naming – That is use number_of_arguments instead of numberOfArgs
  • Look into using format for string formatting – The % is scheduled for depreceation, and you should rather use print('Incorrect number of arguments: {}'.format(number_of_arguments)). For more on this see Format specification mini language, on that page there is also useful examples and syntax for how to pretty print using format.

I guess you might have heard of PEP8, which is the style guideline for Python. Contrary to a lot of other programming languages, this style guideline is actually used a lot, and is the main standard for coding in Python.

Your code looks clean, and I like that you've commented using docstrings moth the module/file and the function. Mast does have a point that you can accomplish the same using message[::-1], but part of going into a new language is learning what the language can offer in standard libraries.

Do look into using slice'ing, which is extremely powerful and useful. A challenge for you is to resolve Project Euler #13: Large sum using Python and sliceing. I think you'll get some pleasant surprises related to string vs number handling, and handling of large numbers as well.

Two other comments related to style issues:

  • Use snake_case for variable and function naming – That is use number_of_arguments instead of numberOfArgs
  • Look into using format for string formatting – The % is scheduled for depreceation, and you should rather use print('Incorrect number of arguments: {}'.format(number_of_arguments)). For more on this see Format specification mini language, on that page there is also useful examples and syntax for how to pretty print using format.

I guess you might have heard of PEP8, which is the style guideline for Python. Contrary to a lot of other programming languages, this style guideline is actually used a lot, and is the main standard for coding in Python.

Your code looks clean, and I like that you've commented using docstrings moth the module/file and the function. Mast does have a point that you can accomplish the same using message[::-1], but part of going into a new language is learning what the language can offer in standard libraries.

Do look into using slice'ing, which is extremely powerful and useful. A challenge for you is to resolve Project Euler #13: Large sum using Python and sliceing. I think you'll get some pleasant surprises related to string vs number handling, and handling of large numbers as well.

Two other comments related to style issues:

  • Use snake_case for variable and function naming – That is use number_of_arguments instead of numberOfArgs
  • Look into using format for string formatting – The % is scheduled for depreceation, and you should rather use print('Incorrect number of arguments: {}'.format(number_of_arguments)). For more on this see Format specification mini language, on that page there is also useful examples and syntax for how to pretty print using format.
Source Link
holroy
  • 11.7k
  • 1
  • 27
  • 59

I guess you might have heard of PEP8, which is the style guideline for Python. Contrary to a lot of other programming languages, this style guideline is actually used a lot, and is the main standard for coding in Python.

Your code looks clean, and I like that you've commented using docstrings moth the module/file and the function. Mast does have a point that you can accomplish the same using message[::-1], but part of going into a new language is learning what the language can offer in standard libraries.

Do look into using slice'ing, which is extremely powerful and useful. A challenge for you is to resolve Project Euler #13: Large sum using Python and sliceing. I think you'll get some pleasant surprises related to string vs number handling, and handling of large numbers as well.

Two other comments related to style issues:

  • Use snake_case for variable and function naming – That is use number_of_arguments instead of numberOfArgs
  • Look into using format for string formatting – The % is scheduled for depreceation, and you should rather use print('Incorrect number of arguments: {}'.format(number_of_arguments)). For more on this see Format specification mini language, on that page there is also useful examples and syntax for how to pretty print using format.
lang-py

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