Skip to content

Instantly share code, notes, and snippets.

@isvaldo
Created April 13, 2015 01:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save isvaldo/a85d99a6c2ae25084a05 to your computer and use it in GitHub Desktop.
Save isvaldo/a85d99a6c2ae25084a05 to your computer and use it in GitHub Desktop.
Gerando palavras aleatórias com python
# -*- coding: utf-8 -*-
import random
def rd_string(length):
"""
Criando Strings aleatórias usando casting
"""
str_rd = ""
while(len(str_rd)<=length):
str_rd += '%c' % random.randint(97,122)
return str_rd
# Testing
for n in range(0,100):
print rd_string(n
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment