import randomdef get_code(): code = '' for i in range(5): num = random.randrange(10) s = chr(random.randint(97,122)) single = random.choice([str(num),s]) code +=single return code