Skip to content

Commit 10ba239

Browse files
authored
Merge pull request Show-Me-the-Code#202 from ammmerzougui/master
Create test.py
2 parents 6238d91 + 2e7a173 commit 10ba239

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

‎ammmerzougui/0001/test.py‎

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
'''
2+
Generating a random code
3+
By @ammmerzougui
4+
'''
5+
importrandom
6+
7+
defgenCode(length):
8+
s="abcdefghijklmnopqrstuvwxyz01234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ!@#$%^&*()?"
9+
return"".join(random.sample(s,length))
10+
l=input("Enter the length of the random code: ")
11+
print(genCode(int(l)))

0 commit comments

Comments
(0)