Tag Info

New answers tagged

1

With minimum modification to your code, this should work (but this is still a pretty odd way to write a function) X := (v = 1; While[v > 0.1, v = RandomVariate[UniformDistribution[{0, 1}], 1][[1]]; Print["~", v]]; v) X


0

The # represents the variable and the & indicates a pure function. The _ in _? represents an arbitrary pattern and the _? indicates a query with an answer of either True or False. So your code can be "read" as: Search the given list of integers for elements that fit the pattern for which the pure function "is it greater than 7" yields True, and return ...



Top 50 recent answers are included