I'm reviewing for a test over some basic Python syntax stuff and I'm wanting to make sure I have a proper understanding of the difference between a symbol and an operator. A symbol can be a string of characters or a operator and an operator can only be something that does something to characters or strings right?

2 Answers
2

Operator is a syntactic representation for some important Python function. For example, and infix + operator as in a + b. There is a module called operator to represent standard operators as functions. Also, special methods (as in the hus787 comment above) can override operators for instances of a class.

Symbol is an element of Python grammar. Symbol can represent a whole program, a statement, operator, name, literal, etc, even indent and dedent (in case of Python).

A symbol in a programming language is either a binding to some value (eg. variable identifiers), a value itself (eg. "foo", 123, True), keyword (eg. def, class, import,try, except,...) or other language specific construct( (), {}, [],...).
So a symbol does not always have to be a string of characters.

In contrast, an operator defines a specific function among one or more values. (There are unary, binary, tertiary,... operators)
eg. + in 1+1, < in a<b are operators

It's noteworthy if you are considering this idea in a compiler's standpoint, everything you write in your code is a symbol. That is even +, - , *, / , are mere symbols to a lexical analyzer. (I assume that this fact is out of the scope of your question). Hence we will restrict our answer to the domain of language syntax.