Posts by Marcos Henrique Duarte • 3 points
3 posts
-
-1
votes1
answer45
viewsQ: variable cannot admit another value
n=int(input("jogadas:")) a=22695477 b=1 m=2**32 semente=3 i=1 num=None num_aleatorio = None lance_computador = None while i <= n: lance_jogador=int(input("Faça sua jogada")) if i==1: num =…
-
-1
votes1
answer151
viewsQ: how to make the function follow a sequence?
def fnum_aleatorio(): a=22695477 b=1 m=2**32 semente=3 num= semente num_aleatorio = (num*a + b)%m if num_aleatorio <= m//2: return 0 else: return 1 i have this function, I want it to return me 0…
-
0
votes2
answers16086
viewsQ: unboundlocalerror problem: local variable 'num' referenced before assignment
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…