兰特:均匀(2)。提供1或2.兰德:uniform(1)只给出1 i,e rand:uniform(N)提供1到N之间的随机数。怎么样给我0或1?我想在每次迭代中给我0或1,即如果我们尝试两次而不是0 0或1 1是否可能?
答案 0 :(得分:2)
你想要一个介于0和1之间的随机数,每次它必须是不同的吗? 01010101010 ...唯一的随机数是第一个。
[RemoteTestNG] detected TestNG version 6.14.3
[2018-05-04T21:54:54,703][INFO ][TestNG-test=testpkg-2] Here's the second test!
[2018-05-04T21:54:54,703][INFO ][TestNG-test=testpkg-1] This is the first test!
[2018-05-04T21:54:54,709][WARN ][TestNG-test=testpkg-1] Something may be wrong, better take a look.
[2018-05-04T21:54:54,709][ERROR][TestNG-test=testpkg-2] There's a problem, better fix it
===============================================
My suite
Total tests run: 2, Failures: 0, Skips: 0
===============================================