How to check if a function exists in module with Python

1 Answer

0 votes
import math

if hasattr(math, 'pow'):
    print("pow function found")
else:
    print("pow function not found")

       
                  

'''
run:

Fasle

'''

 



answered Feb 22, 2023 by avibootz
...