#!/usr/bin/env python
# coding: utf-8
# # Python Program to Generate Password
# In[10]:
#import random module
import random
#User input for password length
passlen = int(input("Enter the length of password : "))
#storing letters, numbers and special characters
s="abcdefghijklmnopqrstuvwxyz01234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ!@#$%^&*()?"
#random sampling by joining the length of the password and the variable s
p = "".join(random.sample(s,passlen ))
print(p)
#clcoding.com
# In[ ]:
0 Comments:
Post a Comment