Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

Turn string into operator python

op = {'+': lambda x, y: x + y,
      '-': lambda x, y: x - y}
print(op['+'](1,2))
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #Turn #string #operator #python
ADD COMMENT
Topic
Name
8+4 =