If OP is asking for a random int that is +/- but not 0, then there's this: ... x = np.random.randn() if np.random.randn() > 0: print(x > 0) else: ...
確定! 回上一頁