Is there any way to get different values for different blanks with ReplaceAll[]
? For example, I would like to do something like:
{_,_,_}/. _Blank -> RandomInteger[{1, 10}]
But, the output comes out as all the same random integer for each blank, such as:
{4, 4, 4}
Is there an efficient way to get an output that is more random, like:
{4, 7, 1}
,as shown above?
Thanks!
Replace[{_, _, _}, _ :> RandomInteger[{1, 10}], {1}]
would do what you ask for, but why not just useRandomInteger[{1,10}, 3]
instead? $\endgroup$