Alors j'écris un jeu pour une compétition.Problème de multiplication et de division en Python
Jusqu'à présent, l'utilisateur a entré un nombre.
if user % 2 == 0 :
print("What you entered is an even number.")
print("")
print("So, according to RULE 1, we must now divide it by 2.")
int(user)/ 2
thing2 = "So, now we're left with " + str(user) + "."
print (thing2)
else :
print("What you entered is an odd number.")
print("")
print("So, according to RULE 1, we must now multiply it by 3, and add 1.")
int(user) * 3
user += 1
thing2 = "So, now we're left with " + str(user) + "."
print (thing2)
.... Mais la partie int(user) * 3
ne se multiplie pas en fait le nombre de 3, mais elle ajoute un. Pour l'anecdote, j'ai essayé des tas de possibilités comme avoir juste user * 3
(sans la chose int() là-bas) et je suis un débutant chez Python.
Merci, désolé c'était une erreur tellement stupide. – gingepusscat123