Random Lowercase String Generator

  • Share this:

Code introduction


This function generates a random lowercase letter string of specified length.


Technology Stack : random, string

Code Type : Function

Code Difficulty : Intermediate


                
                    
def random_word(length):
    import random
    import string
    letters = string.ascii_lowercase
    return ''.join(random.choice(letters) for i in range(length))

# JSON representation                
              
Tags: