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 : datetime, random, string
Code Type : Function
Code Difficulty : Beginner
import datetime
import random
import string
def generate_random_string(length):
return ''.join(random.choices(string.ascii_lowercase, k=length))