You can download this code by clicking the button below.
This code is now available for download.
This function generates a random string of lowercase letters of specified length.
Technology Stack : string, random
Code Type : String generation
Code Difficulty : Intermediate
import string
import random
def generate_random_string(length=10):
return ''.join(random.choices(string.ascii_lowercase, k=length))