>>134
これはちょっと汚ないなあ。
とりあえず、数字を重複させたくないなら、
strnumseq = map(str,range(10))
s = "".join((strnumseq.pop(random.randrange(10-x)) for x in range(N)))
で一発。