Best method for a menu in a command line program?

Ben Finney ben+python at benfinney.id.au
Wed Nov 3 23:06:20 EDT 2010


Ben Finney <ben+python at benfinney.id.au> writes:

> Here's my attempt at making it more Pythonic and maintainable::

[…]

>     def celsius_to_fahrenheit(in_value):
>         return ((in_value * (9.0/5) + 32.0))

Hmm. I went a bit overboard with the parens. This is what I'd prefer::

    def celsius_to_fahrenheit(in_value):
        return (in_value * (9.0/5) + 32.0)

-- 
 \          “There's a certain part of the contented majority who love |
  `\            anybody who is worth a billion dollars.” —John Kenneth |
_o__)                                            Galbraith, 1992-05-23 |
Ben Finney



More information about the Python-list mailing list