def bpm(max_strokes):
 t0 = None
 dt = []
 for i in range(max_strokes):
  s = input()
  if (s == ''):
   t1 = time.time()
   if t0:
    dt.append((t1 - t0))
   t0 = t1
  else:
   break
 ave = (sum([((1.0 / dti) * 60) for dti in dt]) / len(dt))
 return ave

def bpm ( max_strokes ) : t0 = None dt = [ ] for i in range ( max_strokes ) : s = input ( ) if ( s == '' ) : t1 = time . time ( ) if t0 : dt . append ( ( t1 - t0 ) ) t0 = t1 else : break ave = ( sum ( [ ( ( 1.0 / dti ) * 60 ) for dti in dt ] ) / len ( dt ) ) return ave
returns average bpm listening to enter keystrokes .