Thursday, January 22, 2026
HomeLanguagespprint function in SymPy

pprint function in SymPy

The pprint() takes two arguments, one is an expression and the other is the use_unicode argument, the use_unicode is a boolean argument. In case the terminal does not support Unicode then ASCII printer is used by default or else we need to pass use_unicode=False. And to call this function the user needs to first import the SymPy library. Here the SymPy variables are defined using the Symbols class.

Syntax:

pprint()

Example 1: Here the Unicode is set to false, so the Ascii codes are used in output.

Python3




# import everything from sympy module
from sympy import *
  
x, y, z, t = symbols('x y z t')
pprint(Integral(sqrt(x)*((x**3)/y), x), use_unicode=False)


 Output

Example 2: Here the Unicode is set to true, so the Unicode codes are used in output.

Python3




# import everything from sympy module
from sympy import *
  
x, y, z, t = symbols('x y z t')
pprint(Integral(sqrt(x)*((x**3)/y), x), use_unicode=True)


 Output

Dominic
Dominichttp://wardslaus.com
infosec,malicious & dos attacks generator, boot rom exploit philanthropist , wild hacker , game developer,
RELATED ARTICLES

Most Popular

Dominic
32475 POSTS0 COMMENTS
Milvus
119 POSTS0 COMMENTS
Nango Kala
6847 POSTS0 COMMENTS
Nicole Veronica
11977 POSTS0 COMMENTS
Nokonwaba Nkukhwana
12064 POSTS0 COMMENTS
Shaida Kate Naidoo
6986 POSTS0 COMMENTS
Ted Musemwa
7220 POSTS0 COMMENTS
Thapelo Manthata
6933 POSTS0 COMMENTS
Umr Jansen
6912 POSTS0 COMMENTS