Friday, October 24, 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
32361 POSTS0 COMMENTS
Milvus
88 POSTS0 COMMENTS
Nango Kala
6728 POSTS0 COMMENTS
Nicole Veronica
11892 POSTS0 COMMENTS
Nokonwaba Nkukhwana
11954 POSTS0 COMMENTS
Shaida Kate Naidoo
6852 POSTS0 COMMENTS
Ted Musemwa
7113 POSTS0 COMMENTS
Thapelo Manthata
6805 POSTS0 COMMENTS
Umr Jansen
6801 POSTS0 COMMENTS