Python | sympy.trailing() method Last Updated : 05 Sep, 2019 Comments Improve Suggest changes Like Article Like Report 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. Syntax: trailing(n) Parameter: n - It denotes the number for which the largest power of 2 that divides that number is determined. Returns: Returns the largest power of 2 that divides the given number. Example #1: Python3 # import trailing() method from sympy from sympy.ntheory.factor_ import trailing n = 64 # Use trailing() method trailing_n = trailing(n) print("The largest power of 2 that divides {} is 2^{}.". format(n, trailing_n)) Output: The largest power of 2 that divides 64 is 2^6. Example #2: Python3 # import trailing() method from sympy from sympy.ntheory.factor_ import trailing n = 130 # Use trailing() method trailing_n = trailing(n) print("The largest power of 2 that divides {} is 2^{}.". format(n, trailing_n)) Output: The largest power of 2 that divides 130 is 2^1. Comment More infoAdvertise with us Next Article Python | sympy.trailing() method R rupesh_rao Follow Improve Article Tags : Python Practice Tags : python Similar Reads Python String rstrip() Method The rstrip() method removes trailing whitespace characters from a string. We can also specify custom characters to remove from end of string.Let's take an example to remove whitespace from the ends of a string.Pythons = "Hello Python! " res = s.rstrip() print(res)OutputHello Python! Syntax of rstrip 2 min read Python String rsplit() Method Python String rsplit() method returns a list of strings after breaking the given string from the right side by the specified separator. It's similar to the split() method in Python, but the difference is that rsplit() starts splitting from the end of the string rather than from the beginning. Exampl 3 min read Python | sympy.S() method With the help of sympy.S() method, we can make a single instance of an object by using sympy.S() method, where S denotes to singleton class. Syntax : sympy.S() Return : Return the single instance of an object. Example #1 : In this example we can see that by using sympy.S() method, we are able to cre 1 min read Python - String min() method The min() function in Python is a built-in function that returns the smallest item in an iterable or the smallest of two or more arguments. When applied to strings, it returns the smallest character (based on ASCII values) from the string.Let's start with a simple example to understand how min() wor 2 min read Python | sympy.sec() method With the help of sympy.sec() method, we are able to find the value of sec theta using sympy.sec() function. Syntax : sympy.sec() Return : Return value of sec theta. Example #1 : In this example we can see that by using sympy.sec() method, we can find the value of sec theta. Python3 1=1 # import symp 1 min read Like