Friday, September 5, 2025
HomeLanguagesPython | sympy.is_odd() method

Python | sympy.is_odd() method

In the sympy module, we can test whether a given number n is odd or not using sympy.is_odd() function.

Syntax:  sympy.is_odd(n)
Parameter:  n; number to be tested
Return:  bool value result 

Code #1: 

Python3




# Python program to check odd number
# using sympy.is_odd() method
 
# importing sympy module
from sympy import *
 
# calling is_odd function on different numbers
geek1 = simplify(30).is_odd
geek2 = simplify(13).is_odd
 
print(geek1)
print(geek2)


Output:

False
True

Code #2: 

Python3




# Python program to check odd number
# using sympy.is_odd() method
 
# importing sympy module
from sympy import *
 
# calling is_odd function on different numbers
geek1 = simplify(2).is_odd
geek2 = simplify(2.5).is_odd
 
 
print(geek1)
print(geek2)


Output:

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

Most Popular

Dominic
32264 POSTS0 COMMENTS
Milvus
81 POSTS0 COMMENTS
Nango Kala
6634 POSTS0 COMMENTS
Nicole Veronica
11801 POSTS0 COMMENTS
Nokonwaba Nkukhwana
11863 POSTS0 COMMENTS
Shaida Kate Naidoo
6750 POSTS0 COMMENTS
Ted Musemwa
7025 POSTS0 COMMENTS
Thapelo Manthata
6701 POSTS0 COMMENTS
Umr Jansen
6718 POSTS0 COMMENTS