Skip to main content
added 62 characters in body
Source Link
Gari BN
  • 634
  • 5
  • 7

python 3, 38

print(1==bin(int(input())).count('1')) 

python, 32

However, the code doesn't work in every version.

print 1==bin(input()).count('1') 

Notice that the solution works also for 0 (print False).

python 3, 38

print(1==bin(int(input())).count('1')) 

python, 32

However, the code doesn't work in every version.

print 1==bin(input()).count('1') 

python 3, 38

print(1==bin(int(input())).count('1')) 

python, 32

However, the code doesn't work in every version.

print 1==bin(input()).count('1') 

Notice that the solution works also for 0 (print False).

deleted 1 characters in body
Source Link
Gari BN
  • 634
  • 5
  • 7

python 3, 38

print(1==bin(int(input())).count('1')) 

python, 33 32

However, the code doesn't work in every version.

print( 1==bin(input()).count('1')) 

python 3, 38

print(1==bin(int(input())).count('1')) 

python, 33

However, the code doesn't work in every version.

print(1==bin(input()).count('1')) 

python 3, 38

print(1==bin(int(input())).count('1')) 

python, 32

However, the code doesn't work in every version.

print 1==bin(input()).count('1') 
Source Link
Gari BN
  • 634
  • 5
  • 7

python 3, 38

print(1==bin(int(input())).count('1')) 

python, 33

However, the code doesn't work in every version.

print(1==bin(input()).count('1'))