Skip to main content
edited body
Source Link
  • At the top of the module use triple quotes to document things instead of using comments. At the top level it will also act as a docstring for your module.
  • Use random.choice on the iterable instead of getting a random int first and then using it get an from iterable.
  • if answer == "Y" or answer == "y" etc can be replaced with if answer.lower() == "y".
  • Use better variables names, for example a and b in FunRun(a, b) doesn't make any sense.
  • Use new style string formatting instead of the old sprintf basesbased syntax. Or better join str.join in your case if you want to merge bunch of items.
  • Your code has too many PEP 8 issues as per PEP8 online tool. You should check PEP 8 and use extensions like flake8, pylint etc to catch those.
  • At the top of the module use triple quotes to document things instead of using comments. At the top level it will also act as a docstring for your module.
  • Use random.choice on the iterable instead of getting a random int first and then using it get an from iterable.
  • if answer == "Y" or answer == "y" etc can be replaced with if answer.lower() == "y".
  • Use better variables names, for example a and b in FunRun(a, b) doesn't make any sense.
  • Use new style string formatting instead of the old sprintf bases syntax. Or better join str.join in your case if you want to merge bunch of items.
  • Your code has too many PEP 8 issues as per PEP8 online tool. You should check PEP 8 and use extensions like flake8, pylint etc to catch those.
  • At the top of the module use triple quotes to document things instead of using comments. At the top level it will also act as a docstring for your module.
  • Use random.choice on the iterable instead of getting a random int first and then using it get an from iterable.
  • if answer == "Y" or answer == "y" etc can be replaced with if answer.lower() == "y".
  • Use better variables names, for example a and b in FunRun(a, b) doesn't make any sense.
  • Use new style string formatting instead of the old sprintf based syntax. Or better join str.join in your case if you want to merge bunch of items.
  • Your code has too many PEP 8 issues as per PEP8 online tool. You should check PEP 8 and use extensions like flake8, pylint etc to catch those.
Source Link

  • At the top of the module use triple quotes to document things instead of using comments. At the top level it will also act as a docstring for your module.
  • Use random.choice on the iterable instead of getting a random int first and then using it get an from iterable.
  • if answer == "Y" or answer == "y" etc can be replaced with if answer.lower() == "y".
  • Use better variables names, for example a and b in FunRun(a, b) doesn't make any sense.
  • Use new style string formatting instead of the old sprintf bases syntax. Or better join str.join in your case if you want to merge bunch of items.
  • Your code has too many PEP 8 issues as per PEP8 online tool. You should check PEP 8 and use extensions like flake8, pylint etc to catch those.