I'm a beginner in Python and I can't figure out the assignment of an operator to a variable.
I've read assign operator to variable in python? but I still can't figure out my problem.
a = str(+)
This line of code gives an Invalid Syntax Error.
Whereas, a =input() works completely fine when we give an operator as input. This operator is stored as string type because whatever you enter as input, input function converts it into a string.
Why str() is not able to store an operator as a string whereas input() can do the same task without any error?
a = "+"