+ 1
Does the Import Module shows random strings rather than numbers(randint)?
Alternatively, is there such thing as "random.randstr" in the random module?
1 Antwort
+ 2
"""
I think not... (but I can be wrong ;P)
Anyway, you can easily write a custom function for that purpose:
"""
import random
def randstr(maxlength):
s = '';
while maxlength:
s += chr(random.randint(32,127))
maxlength -= 1
return s
print(randstr(42))
https://code.sololearn.com/c3JWd146RIFq/?ref=app