Obtenez un nombre aléatoire positif ou négatif Python

import random
return 1 if random.random() < 0.5 else -1
Flying Donkey