Skip to content

Instantly share code, notes, and snippets.

@popey456963
Created October 28, 2015 14:51
Show Gist options
  • Select an option

  • Save popey456963/1ed2187ecbf07b030dba to your computer and use it in GitHub Desktop.

Select an option

Save popey456963/1ed2187ecbf07b030dba to your computer and use it in GitHub Desktop.
Only Ones
x=int(input())
if bin(x)[2:].count("1") == len(bin(x))-2:
print("true")
else:
print("false")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment