0
How do I code in python to get different random outputs for the same input?
2 Réponses
+ 3
You must be more accurate in your description, if you don't want to get blurred answers :P
Anyway, you can even get different random outputs without input:
from random import *
letters = ' abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'
for count in range(5): # arbitrary number of outputs
string = ''
length = randint(10,20) # arbitrary length bounds
for char in range(length):
string += choice(letters)
print(str(count)+'> '+string)
0
use random module