Posts by Kleber Rock • 7 points
2 posts
-
-2
votes7
answers49622
viewsA: How to add elements from a list and return the result as an integer?
def soma_elementos(lista): l = lista soma = 0 for i in range(len(l)): soma += l[i] return soma l = [] while True: x = int(input('Numero: ')) if x ==…
pythonanswered Kleber Rock 7 -
0
votes2
answers2029
viewsA: PYTHON - NIM game (problem with computer fix starting or not)
I used the Code below, which was a contribution of friends and I gave an improved def computador_escolhe_jogada(n, m): computadorRemove = 1 while computadorRemove != m: if (n - computadorRemove) %…
pythonanswered Kleber Rock 7