MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/Python/comments/1gk9vz/creating_python_commandline_applications/cal6es6/?context=3
r/Python • u/pauloortins • Jun 18 '13
20 comments sorted by
View all comments
8
Also,
import operator functions = { 'add': operator.add 'subtract': operator.sub 'multiply': operator.mul 'divide': operator.truediv }
instead of
functions = { 'add': lambda num1, num2: num1 + num2, 'subtract': lambda num1, num2: num1 - num2, 'multiply': lambda num1, num2: num1 * num2, 'divide': lambda num1, num2: num1 / num2 }
8
u/utdemir Jun 18 '13
Also,
instead of