Skip to content

Commit 2e7a173

Browse files
authored
Create test.py
1 parent 6238d91 commit 2e7a173

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

‎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+
import random
6+
7+
def genCode(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)