Синицын Виктор Сергеевич, 319/1 RaceTesting 9560
Утешева Екатерина, 321 группа RaceTesting 9149
t1import itertoolst1import itertools
22
3def speed(path, stops, times):3def speed(path, stops, times):
4    stops_c = itertools.cycle(stops)4    stops_c = itertools.cycle(stops)
5    path = iter(path)5    path = iter(path)
6    times = iter(times)6    times = iter(times)
7    temp = []7    temp = []
8    st = next(stops_c)8    st = next(stops_c)
9    for i in path:9    for i in path:
10        if len(temp) == st:10        if len(temp) == st:
11            yield (sum(temp) / next(times))11            yield (sum(temp) / next(times))
12            temp = [i]12            temp = [i]
13            st = next(stops_c)13            st = next(stops_c)
14        else:14        else:
15            temp.append(i)15            temp.append(i)
16    yield (sum(temp) / next(times))16    yield (sum(temp) / next(times))
Legends
Colors
 Added 
Changed
Deleted
Links
(f)irst change
(n)ext change
(t)op