Skip to main content
Code Review

Return to Revisions

2 of 2
replaced http://stackoverflow.com/ with https://stackoverflow.com/

Use if __name__ == "__main__":

This:

 if a > 0:
 sgn_a = ""
 if b > 0:
 sgn_b = "+"
 else:
 sgn_b = "-"
 if c > 0:
 sgn_c = "+"
 else:
 sgn_c = "-"
 else:
 sgn_a = "-"
 if b > 0:
 sgn_b = "+"
 else:
 sgn_b = "-"
 if c > 0:
 sgn_c = "+"
 else:
 sgn_c = "-"

can be shortened to

 if a > 0:
 sgn_a = ""
 else:
 sgn_a = "-"
 if b > 0:
 sgn_b = "+"
 else:
 sgn_b = "-"
 if c > 0:
 sgn_c = "+"
 else:
 sgn_c = "-"

There also seems to be an extra indentation (4 spaces) at the start of every line. I'm guessing that it is caused when copy-pasting the code.

Also, it is encouraged to use .format() instead of % for formatting strings.

Spikatrix
  • 1k
  • 1
  • 9
  • 21
default

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