-1

How can I return operators in python? I tried this but it didn't work obviously:

def plus():
    return +

Is it even possible to write code like this without using the plus operator?

print(3plus()4)
jonrsharpe
  • 115,751
  • 26
  • 228
  • 437
steve
  • 311
  • 3
  • 10

1 Answers1

0

Like this

import operator
print(operator.add(3,4))
Wasif
  • 14,755
  • 3
  • 14
  • 34