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 using lowercase letters.
Technology Stack : random
Code Type : String generation
Code Difficulty : Beginner
import random
def generate_random_string(length, letters="abcdefghijklmnopqrstuvwxyz"):
return ''.join(random.choice(letters) for i in range(length))