You can download this code by clicking the button below.
This code is now available for download.
This function generates a random string of a specified length, which only contains lowercase letters.
Technology Stack : random, string manipulation
Code Type : Generate random strings
Code Difficulty :
import random
def generate_random_string(length=10):
letters = 'abcdefghijklmnopqrstuvwxyz'
result_str = ''.join(random.choice(letters) for i in range(length))
return result_str