Python PasswordGenerator Project














































Python PasswordGenerator Project





Password Generator Project is a basic project in python for beginner.To make this project we have to import two module in python.

1.String
2.Random

I have used some constants from String Module which are given in detail below.

string.ascii_lowercase
The lowercase letters "abcdefghijklmnopqrstuvwxyz". This value is not locale-dependent and will not change.

string.ascii_uppercase
The uppercase letters "ABCDEFGHIJKLMNOPQRSTUVWXYZ". This value is not locale-dependent and will not change.

string.digits
The string "0123456789".

string.punctuation
String of ASCII characters which are considered punctuation characters in the C locale: "!#$%&'()*+,-./:;<=>?@[]^_`{|}~.


In random module I have used shuffle method: The shuffle() method takes a sequence (list, string, or tuple) and reorganize the order of the items.

Here is the code of password generator project.

# First we import string and random module in python.
import string

import random

# Here i took a empty list.
s=[]

s1=list(string.ascii_lowercase)

s2=list(string.ascii_uppercase)

s3=list(string.digits)

s4=list(string.punctuation)

s.extend(s1)

s.extend(s2)

s.extend(s3)

s.extend(s4)

l=int(input("Enter the length of your password:\n"))

random.shuffle(s)

print("Your PassWord is :")

print("".join(s[0:l]))


Below is the output of the program:)

Enter the length of your password:
6
Your PassWord is :
eNED9;





More Articles of Rohit Kumar:

Name Views Likes
Python Copy ShallowCopy 323 4
Python PyGreSQL Classic PyGreSQL Interface Advanced Features 409 3
Python Nested Functions 398 3
Python PyGreSQL Classic PyGreSQL Interface DB Wrapper Class 475 3
Python Event Loop 391 4
Python PyGreSQL DB-API PyGreSQL Interface Functions 441 3
Python Shlex get_token() Method 681 4
Python Class Method Use 420 4
Python PyGreSQL Classic PyGreSQL Interface System Catalogs Examples 436 3
Python Multiple Vs Multi-level Inheritence 582 4
Python Shlex error_leader() Method 401 4
Python PyGreSQL Classic PyGreSQL Interface LargeObject 396 3
Python Bisect Insertion Functions 267 4
Python Multiple Inheritence 370 3
Python shlex class 499 4
Python Class Method 404 4
Python Shlex Quoted String 569 3
Python Shlex Methods 461 4
Python PyGreSQL Introduction 637 4
Python PasswordGenerator Project 769 4
Python Shlex Difference between Non-Posix and Posix Parsing 481 3
Python Shlex Functions 870 4
Python Shlex Split Example 520 3
Python PyGreSQL DB-API PyGreSQL Interface Cursor Object 447 3
Python Shlex Error-Handling 479 4
Python Copy deepcopy() 343 4
Python Shlex shlex.split() Vs re.split() 742 3
Python Server Program 748 4
Python Thumb Rule 636 4
Python Class Method Vs Static Method 535 4
Python PyGreSQL Classic PyGreSQL Interface Connection Object 476 4
Python PyGreSQL DB-API 2.0 Interface 465 4
Python PyGreSQL DB-API PyGreSQL Interface Connection Object 400 3
Python Bisect Functions 325 3
Python Loop Types 361 4
Python Bisect Introduction 472 4
Python Copy Introduction 310 4
Python PyGreSQL Classic PyGreSQL Interface Functions 457 3
Python PyGreSQL Classic PyGreSQL Interface SQL Functions Examples 415 3
Python Shlex Introduction 600 4
Python PyGreSQL Classic PyGreSQL Interface Basic Example 644 3
Python Shlex read_token() Method 505 3
Python Copy Shallowcopy Vs Deepcopy 295 4

Comments