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 ** i
  6. return pom# your code goes here
  7. print(na10("101010"))
  8.  
Success #stdin #stdout 0.04s 9720KB
stdin
Standard input is empty
stdout
42