2011-10-06, 02:07 AM
import random
Then look up its documentations for RNG features.
Depending on the specific requirements (numbers repeating, non-repeating adjacents, such and such...), figure out an appropriate way to do it. By data structures, I assume your teacher/whoever wants you to use arrays and/or lists, which are what I'd use if the numbers don't repeat themselves.
As for printing everything out in one line, I *think* an efficient way is to concatenate the sub-results into a final string to be output. If I'm not mistaken, concatenating string in Python involves only a + operator.
Then look up its documentations for RNG features.
Depending on the specific requirements (numbers repeating, non-repeating adjacents, such and such...), figure out an appropriate way to do it. By data structures, I assume your teacher/whoever wants you to use arrays and/or lists, which are what I'd use if the numbers don't repeat themselves.
As for printing everything out in one line, I *think* an efficient way is to concatenate the sub-results into a final string to be output. If I'm not mistaken, concatenating string in Python involves only a + operator.

