fork download
  1. def do(operations):
  2. result = 0
  3. length = len(operations)
  4. list_i = list(range(0,length))
  5. for i in list_i :
  6. if(operations[i]=="--"):
  7. result -= 1
  8. elif(operations[i]=="++"):
  9. result += 1
  10. return result
  11.  
  12.  
  13. experession_list = ["++","++","--","++"]
  14. result = do(experession_list)
  15. print(result)# your code goes here
Success #stdin #stdout 0.03s 9536KB
stdin
Standard input is empty
stdout
2