KateWilson

Untitled

Jan 15th, 2021
732
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. a = [0] * 100
  2. for i in range(50, 101):
  3.     s = bin(i)[2:]
  4.     if s.count('1') > s.count('0'):
  5.         s += '0'
  6.     else:
  7.         s += '1'
  8.     l = len(s) // 2
  9.     s = s[:l-1] + s[l + 1 + (len(s) % 2):]
  10.     a[int(s,2)] = 1
  11.  
  12. print(a.count(1))
RAW Paste Data