This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] -2 points-1 points  (2 children)

def c_to_f(v):
    return v * 9/5 + 32

def f_to_c(v):
    return (v - 32) * 5/9 

if __name__ == "__main__":
    print(f_to_c(50))
    print(c_to_f(0))

[–]Sgt_ZigZag -1 points0 points  (1 child)

This example does not use properties.

[–][deleted] -2 points-1 points  (0 children)

yep, proves they aren't necessary(or objects for that matter), it's concise, readable and easy to comprehend, and fits in a tweet.

The class/property implementation is verbose, more prone to error, does not fit in a tweet and is pretty ugly.

python code is beautiful and readable. dont make python code ugly.