# 231. Power of Two

{% tabs %}
{% tab title="Python" %}

```python
class Solution:
    def isPowerOfTwo(self, n: int) -> bool:
        tmp = 1
        while tmp <= n:
            if tmp == n:
                return True
            tmp *= 2
        return False
```

{% endtab %}
{% endtabs %}
