From 4cbe72c8e5a6517ed15cce84d02674c581418f67 Mon Sep 17 00:00:00 2001 From: xenofem Date: Fri, 26 Jun 2020 17:51:49 -0400 Subject: [PATCH] use truncating division --- waggle-dance.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/waggle-dance.py b/waggle-dance.py index d0aa23f..37b912f 100755 --- a/waggle-dance.py +++ b/waggle-dance.py @@ -15,7 +15,7 @@ def matchings(l): result = [] for i in range(len(l)): matching = [(center, l[i])] - for j in range(1, (len(l)-1)/2 + 1): + for j in range(1, (len(l)-1)//2 + 1): matching.append((l[(i-j)%len(l)], l[(i+j)%len(l)])) result.append(matching) return result @@ -88,7 +88,7 @@ async def on_message(message): pollination_channels = [] channel_names = config['channel_names'].copy() exception_count = 0 - while len(pollination_channels) < len(participants)/2: + while len(pollination_channels) < len(participants)//2: if len(channel_names) > 0: name = channel_names.pop(0) else: