Last active
November 17, 2019 18:27
-
-
Save madwayz/78f0e84c6f5c614022c3a4ff270003ac to your computer and use it in GitHub Desktop.
Генерирует текст из N символов.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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