You can download this code by clicking the button below.
This code is now available for download.
Generate a random string of a specified length
Technology Stack : os, sys, time, random, string, math, cmath
Code Type : String generation
Code Difficulty : Intermediate
import os
import sys
import time
import random
import json
import re
import string
import math
import cmath
def generate_random_string(length):
letters = string.ascii_letters
return ''.join(random.choice(letters) for i in range(length))