Skip to content

Instantly share code, notes, and snippets.

@madwayz
Last active November 17, 2019 18:27
Show Gist options
  • Select an option

  • Save madwayz/78f0e84c6f5c614022c3a4ff270003ac to your computer and use it in GitHub Desktop.

Select an option

Save madwayz/78f0e84c6f5c614022c3a4ff270003ac to your computer and use it in GitHub Desktop.
Генерирует текст из N символов.
def gentext(length=10, need_int=False):
import random
if need_int:
return ''.join([chr(random.randint(48, 57)) for _ in range(length)])
return ''.join([chr(random.randint(65, 90)) if random.randint(0, 1) else chr(random.randint(97, 122)) for _ in range(length)])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment