A literal is notation for representing a fixed (const
) value.
A variable is storage location associated with a symbolic name (pointed to, if you'd like).
It's best explained in use:
foo = bar(42)
^ ^ ^
| | |--- literal, 42 is *literally* 42
| |------- function, also represents "something" in memory
|------------- variable, named "foo", and the content may vary (is variable)
Identifier on the other hand is the name assigned to a variable in a python statement.