0
def fnum_aleatorio(a, b, m, semente=None):
if semente != None:
num=semente
num_aleatorio = (num*a+b)%m
if num_aleatorio <= a//2:
return 0
else:
return 1
I’m trying to make a function that has a 0 or 1 final result, depending on the random number that was created, but I can’t finish because of this error. how to proceed?
thanks for the help! but not yet managed, it seems that it only provides me a number, whenever I run the program, it gives the same result.
– Marcos Henrique Duarte