你好,我现在要学习如何多次调用一个随机变量,而这些变量本身不会加倍。
我现在得到的逻辑是这样的:
get a len of the array the variables are stored in, random.randint(1, len(the_aray))
then print a variables place in the array and question for running it again
if yes, store previous result of random.randint then
if random.randint in previous_results_board, go again..
if not, print the result out
for len var_array = len previous_results_board print
"this is the end of this program" and wait for input,
after typing/pressing whatever the script terminates.
是否还有其他“优化”版本?如果没有,该如何解决将先前结果存储在数组中的问题?