# ShowBF.py from random import uniform as randu import math def B(x): """ Returns True if x is closer to an even integer than to an odd integer and False otherwise PreC: x is a positive float """ L = math.floor(x) R = math.ceil(x) z = True return z if __name__ == '__main__': for k in range(10): x = randu(10,99) if B(x): print x,'yes' else: print x,'no'