Ethan C.
asked 05/21/21
Create 3 string variables str1,str2,and str3 to assign any random strings
Patrick B.
answered 05/21/21
Math and computer tutor/teacher
import random
import string
def randomStr(n):
randstr=''
for i in range(n):
randstr = randstr+str(random.choice(letters))
return(randstr)
########################
# printing letters
letters = string.ascii_letters
str1=randomStr(10)
print (str1)
str2 = randomStr(25)
print(str2)
str3 = randomStr(18)
print(str3)
Still looking for help? Get the right answer, fast.
OR
Find an Online Tutor Now
Choose an expert and meet online.
No packages or subscriptions, pay only for the time you need.