Random Number generator
Anonymous
Plain Text
12/26/2021 1:56 PM
622 B
22
Indexable
Never
import random
import string
def Upper_Lower_string(length): # define the function and pass the length as argument
# Print the string in Lowercase
result = ''.join((random.choice(string.ascii_lowercase) for x in range(length))) # run loop until the define length
print(" Random string generated in Lowercase: ", result)
# Print the string in Uppercase
result1 = ''.join((random.choice(string.ascii_uppercase) for x in range(length))) # run the loop until the define length
print(" Random string generated in Uppercase: ", result1)
Upper_Lower_string(10) # define the length Editor is loading...