I would like to create a functin that determines if round.random(uniform(0,10)) is odd or even
I've tried this as many ways as I can but I'm one green banana import random def randmatch(x): if x == x%2 == 0: return even else: if x == x%2==1: return odd randmatch((round(random.uniform(0,10),2))) OUTPUT =========== RESTART: C:/Users/T/Desktop/Python 3.8/randmatch/rm001.py ========== >>> import random def randmatch(x): if x == x%2 == 0: print(even) else: if x == x%2==1: print(odd) randmatch((round(random.uniform(0,10),2))) OUTPUT =========== RESTART: C:/Users/T/Desktop/Python 3.8/randmatch/rm001.py ========== >>> import random def randmatch(x): x=round(random.uniform(0,10),2) if x == x%2 == 0: print(even) else: if x == x%2==1: print(odd) randmatch(x) OUTPUT =========== RESTART: C:/Users/T/Desktop/Python 3.8/randmatch/rm001.py ========== Traceback (most recent call last): File "C:/Users/T/Desktop/Python 3.8/randmatch/rm001.py", line 10, in <module> randmatch(x) NameError: name 'x' is not defined import random def randmatch(x): x=round(random.uniform(0,10),2) if x is x%2 == 0: print(even) else: if x is x%2=