📜  Python| sympy.is_real 方法

📅  最后修改于: 2022-05-13 01:55:34.443000             🧑  作者: Mango

Python| sympy.is_real 方法

借助sympy.is_real方法,我们可以检查天气元素是否真实,此方法将返回布尔值,即 True 或 False。

示例 #1:
在这个例子中,我们可以看到通过使用sympy.is_real方法,我们能够检查真实值,它会返回一个布尔值。

# import sympy
from sympy import *
  
# Use sympy.is_real method
gfg = simplify(2).is_real
    
print(gfg)

输出 :

示例 #2:

# import sympy
from sympy import *
  
# Use sympy.is_real method
gfg = simplify(5.5).is_real
    
print(gfg)

输出 :