Home > Net >  What is the class of arithmetic operations in python?
What is the class of arithmetic operations in python?

Time:06-27

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?

CodePudding user response:

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.)

  • Related