Title : Write a Python program to check if a given positive integer is a power of two.
Description :
Write a Python program to check if a given positive integer is a power of two.
Source Code:
def is_Power_of_two(n):
return n > 0 and (n & (n - 1)) == 0
print(is_Power_of_two(4))
print(is_Power_of_two(36))
print(is_Power_of_two(16))
Output:
[-10, -20, -30, -40, -50]
.png)