FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
python_reference/useful_scripts/random_string_generator.py at master · codetasks/python_reference · GitHub
codetasks
/
python_reference
Public
forked from
rasbt/python_reference
Notifications
You must be signed in to change notification settings
Fork
0
Star
0
Code
Pull requests
0
Actions
Projects
Wiki
Security and quality
0
Insights
Additional navigation options
Code
Pull requests
Actions
Projects
Wiki
Security and quality
Insights
Expand file tree
Breadcrumbs
python_reference
/
useful_scripts
/
random_string_generator.py
Copy path
More file actions
More file actions
Latest commit
History
History
History
19 lines (15 loc) · 547 Bytes
Breadcrumbs
python_reference
/
useful_scripts
/
random_string_generator.py
Copy path
File metadata and controls
19 lines (15 loc) · 547 Bytes
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
import
string
import
random
def
rand_string
(
length
):
""" Generates a random string of numbers, lower- and uppercase chars. """
return
''
.
join
(
random
.
choice
(
string
.
ascii_lowercase
+
string
.
ascii_uppercase
+
string
.
digits
)
for
i
in
range
(
length
)
)
if
__name__
==
'__main__'
:
print
(
"Example1:"
,
rand_string
(
length
=
4
))
print
(
"Example2:"
,
rand_string
(
length
=
8
))
print
(
"Example2:"
,
rand_string
(
length
=
16
))
# Example1: 5bVL
# Example2: oIIg37xl
# Example2: 7IqDbrf506TatFO9
Back
|
FazBrowse Home
|
New Git URL