fork download
  1. def na10(dana):
  2. pom = 0
  3. for i in range(len(dana)):
  4. x = int(dana[- i -1])
  5. pom = pom + x * 2 ** 1
  6. return pom
  7. print(na10("10100101"))
Success #stdin #stdout 0.1s 14160KB
stdin
Standard input is empty
stdout
Standard output is empty