Python | sympy.trailing() method
With the help of sympy.trailing() method, we can count the number of trailing zero digits in the binary representation of a given number, i.e. determine the largest power of 2 that divides that number.
Attention geek! Strengthen your foundations with the Python Programming Foundation Course and learn the basics.
To begin with, your interview preparations Enhance your Data Structures concepts with the Python DS Course. And to begin with your Machine Learning Journey, join the Machine Learning - Basic Level Course
n – It denotes the number for which the largest power of 2 that divides that number is determined.
Returns the largest power of 2 that divides the given number.
The largest power of 2 that divides 64 is 2^6.
The largest power of 2 that divides 130 is 2^1.