Given a random generator random5(), the return value of random5() is 0 - 4 with equal probability. Use random5() to implement random7().
class Solution(object):
def random7(self):
num = self.random25()
while num > 20:
num = self.random25()
return num % 7
def random25(self):
return 5 * random5() + random5()