Saturday, November 15, 2025
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
32399 POSTS0 COMMENTS
Milvus
95 POSTS0 COMMENTS
Nango Kala
6765 POSTS0 COMMENTS
Nicole Veronica
11917 POSTS0 COMMENTS
Nokonwaba Nkukhwana
11984 POSTS0 COMMENTS
Shaida Kate Naidoo
6889 POSTS0 COMMENTS
Ted Musemwa
7143 POSTS0 COMMENTS
Thapelo Manthata
6838 POSTS0 COMMENTS
Umr Jansen
6840 POSTS0 COMMENTS