fork(2) download
  1. from cmath import *
  2. q=input()
  3. print reduce(lambda x,y:x+y,map(lambda (x,y):phase(x/y)/pi/2,zip(q[1:]+q[:1],q)))
Success #stdin #stdout 0.02s 44680KB
stdin
[1+0j,1+1j,-1+1j,-1-1j,1-1j,1+0j,1-1j,-1-1j,-1+1j,1+1j,1+0j,1+1j,-1+1j,-1-1j,1-1j,1+0j,1+1j,-1+1j,-1-1j,1-1j,1+0j]
stdout
2.0