Symbols and Complex Numbers

This lesson discusses symbolic variables and complex numbers.

Symbolic variables #

Symbolic variables, called symbols, must be defined and assigned to Python variables before they can be used. This is typically done with the Symbol function:

x = Symbol('x' )

To assign multiple symbols in a single function call, we use the symbols function:

x, y, z = symbols('x y z')

creates three symbols representing variables named x, y, and z. In this particular instance, these symbols are all assigned to Python variables of the same name. However, the user is free to assign them to different Python variables, while representing the same symbol, such as a, b, c = symbols('x y z').

It is good practice to have the same names for variables and their associated symbols.

Get hands-on with 1400+ tech skills courses.