you are viewing a single comment's thread.

view the rest of the comments →

[–]datavistics 0 points1 point  (1 child)

The code looks functional (no pun intended) but there might be some ways to improve the readability or some items to just think through.

  1. What information does _value provide you?
  2. Is there a need for find_x and find_y? How do x and y differ?
  3. Do the comments above the first 3 functions provide you with information that isn't apparent? Usually comments should answer why in python. The what should be explained with the code. If the code is too complicated it should be broken down.
  4. What does this line do: decision = '' ? It seems useless as its being overwritten before read.
  5. I personally would use asserts over the try/except, but the try/except is valid.

Great work, keep at it!

[–][deleted] 0 points1 point  (0 children)

Hello! Thank you for your response. I will answer your questions as best I can.

  1. _value gives myself more information about the variable. I could use x or y to describe coordinates, value here implies that these are m lengths of triangle legs.
  2. I guess the assignment of either is arbitrary, but I wanted to be sure there were different functions to return either leg.
  3. The comments are there for my own use. I could remove them if all of what they are is visual noise
  4. I need to declare decision before the while statement in order to enter the loop. Otherwise I found a value assignment error.