-1

I am currently making a simple calculator, and while I was trying to figure out what functions I should assign to tkinter buttons that represent arithmetic operations, this question hit me. So I tried to figure it out by using the type() but the output said it is an invalid syntax. They have meanings and certain functions so they can't just be nothing. What is their class?

  • 1
    Post the code that you tried to run. – Tom Karzes Jun 22 '22 at 03:06
  • 7
    Do you mean operators like `+` and `*`? Those aren't objects, they can't be assigned to anything, it's not even meaningful to ask what class they are. (There are functions equivalent to all of the operators in the `operator` module, which may be of use in your program.) – jasonharper Jun 22 '22 at 03:09
  • 1
    operators aren't objects. – juanpa.arrivillaga Jun 22 '22 at 03:13
  • @jasonharper Yes, I meant operators like `+`, `-`, `*`, `/`. Hopefully I think I can utilize the `operator` module. Thank you. –  Jun 22 '22 at 03:15
  • Which question hit you? Please clarify as comment or edit your question. – IamAshKS Jun 22 '22 at 03:28
  • You can create functions for those operator buttons and do the required arithmetic operation inside those functions. – acw1668 Jun 22 '22 at 08:42

1 Answers1

1

Do you mean operators like + and *? Those aren't objects, they can't be assigned to anything, it's not even meaningful to ask what class they are. (There are functions equivalent to all of the operators in the operator module, which may be of use in your program.)
- jasonharper

Dharman
  • 30,962
  • 25
  • 85
  • 135