You can download this code by clicking the button below.
This code is now available for download.
Generate a random word of a specified length composed of lowercase letters.
Technology Stack : string, random
Code Type : Function
Code Difficulty : Intermediate
import string
import math
import random
import re
def random_word(length):
letters = string.ascii_lowercase
return ''.join(random.choice(letters) for i in range(length))