Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
33 views

Python Front - Merged

The document describes a Python program that generates random passwords. It imports random and string modules, defines a password generation function, gets length from the user, calls the function to generate a password of that length, and prints the output. The conclusion discusses Python's readability, modularity, flexibility and ability to handle user input demonstrated through this program.

Uploaded by

shakaibbelal
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
33 views

Python Front - Merged

The document describes a Python program that generates random passwords. It imports random and string modules, defines a password generation function, gets length from the user, calls the function to generate a password of that length, and prints the output. The conclusion discusses Python's readability, modularity, flexibility and ability to handle user input demonstrated through this program.

Uploaded by

shakaibbelal
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 9

MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION, MUMBAI

A
MICRO PROJECT REPORT
ON

“PASSWORD GENERATOR”

Subject Name: Programming With Python

Subject Code: 22616

SUBMITTED BY

1. SHAKAIB BELAL ZAKI IQBAL 2117260019

2. ALTAMASH FURQUAN AHMED 2117260023


3. SHEIKH AMAN SHEIKH RAJU 2117260035

GUIDED BY
Ms. Misbah Kauser

Al Jamia Mohammediyah Education Society’s


MAULANA MUKHTAR AHMAD NADVI TECHNICAL CAMPUS
DEPARTMENT OF COMPUTER ENGINEERING
Academic Year 2023-24
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION, MUMBAI

CERTIFICATE
This is to certify that Miss.
SHAKAIB BELAL ZAKI IQBAL Seat No: 494276
ALTAMASH FURQUAN AHMED Seat No: 494278
SHEIKH AMAN SHEIKH RAJU Seat No: 494279
Of Sixth Semester of Diploma in Computer Engineering of Institute,
Maulana Mukhtar Ahmad Nadvi Technical Campus, Malegaon.
(Code: 1726) Course of Programming With Python [22616] for the
Academic Year 2023-24 as prescribed in the Curriculum.

Place: ……………………. Date: ……………………...

Subject In-charge HOD Principal


Ms. Misbah Kauser Mr. Rasheed Noor Dr. MD. Azhar
DEPARTMENT OF COMPUTER ENGINEERING

VISION
To build strong research and learning environment producing globally
competent professionals and innovators who will contribute to the betterment of
the society.

MISSION
• To create and sustain an academic environment Conducive to the highest
level of research and teaching.
• To provide state-of-the-art laboratories which will be up to date with the
new developments in the area of computer engineering.
• To organize competitive event, industry interactions and global
collaborations in view of providing a nurturing environment for students
to prepare for a successful career and the ability to tackle lifelong
challenges in global industrial needs.
• To educate students to be socially and ethically responsible citizens I
view of national and global development.
INDEX

Sr. Topic Page


No No
INTRODUCTION
1 1

2 THEORY CONCEPTS 2

3 SOURCE CODE 3

4 OUTPUT 4

5 CONCLUSION 5
1. INTRODUCTION

Python is a high-level, interpreted programming language known for its simplicity and readability. It
supports multiple programming paradigms, including procedural, object-oriented, and functional
programming. Python's syntax emphasizes code readability, making it easier to write and maintain. It has a
comprehensive standard library and a large ecosystem of third-party libraries, making it suitable for a wide
range of applications, from web development to data science and machine learning.

The random module in Python provides functions for generating pseudo-random numbers. These numbers
are not truly random but are generated using a deterministic algorithm. The random module includes
functions for generating random integers, floating-point numbers, and sequences like lists. It also allows
for setting a seed value to produce reproducible sequences of random numbers.

The range function in Python generates a sequence of numbers. It is commonly used in for loops to iterate
over a sequence of numbers. The range function takes one, two, or three arguments: start, stop, and step.
By default, it starts from 0, increments by 1, and stops before the specified stop value. The range function
is memory-efficient because it generates numbers on demand, rather than storing them all in memory at
once.
The text area serves as the workspace for users to input and edit text, while a scroll pane
accommodates longer documents. The inclusion of a file chooser enhances user interaction by
simplifying file management operations. The "New," "Open," "Save," and "Save As" options
provide a comprehensive set of features for document manipulation. Error-handling mechanisms,
implemented through dialogs, enhance the robustness of the application.

In conclusion, the Simple Notepad application showcases the power and flexibility of Java in
creating practical desktop applications. Through the Swing framework, developers can efficiently
design user-friendly interfaces, demonstrating Java's commitment to cross-platform
compatibility and ease of use. This notepad application serves as a testament to Java's capabilities
in delivering reliable and intuitive software solutions.

1|Page
2. THOERY CONCEPTS

Import modules: The program starts by importing the random and string modules. The random
module is used to generate random values, and the string module provides various string
constants and functions.

Define the generate_password function: This function takes an optional length parameter (default
is 12) and generates a random password of the specified length. It creates a string of characters
by concatenating the ASCII letters, digits, and punctuation characters from the string module.
Then, it uses a list comprehension to select length number of characters randomly from this string
and joins them together to form the password.

Main program logic: The program then checks if it's being run as the main program (if __name__
== "__main__":). If it is, it prompts the user to enter the length of the password they want to
generate using the input function. The input is converted to an integer using int() and stored in
the length variable. Then, it calls the generate_password function with the user-provided length
and stores the generated password in the password variable.

Print the generated password: Finally, it prints the generated password to the console using print.

Running the program: When you run this program, it will prompt you to enter the length of the
password you want to generate. After entering the length, it will generate a random password of
that length and display it on the screen.

This program demonstrates how to use the random module to generate random values and the
string module to work with string constants. It also shows how to define functions and handle
user input in Python.

2|Page
3. SOURCE CODE

import random
import string

def generate_password(length=12):
characters = string.ascii_letters + string.digits + string.punctuation
password = ''.join(random.choice(characters) for i in range(length))
return password

if __name__ == "__main__":
length = int(input("Enter the length of the password: "))
password = generate_password(length)
print("Generated Password:", password)

3|Page
4. OUTPUT

4|Page
5. CONCLUSION

The password generator program illustrates Python's robust capabilities in practical software
development. It utilizes the random and string modules to create a secure and customizable password
generation tool. By allowing users to specify the length of the password, the program ensures flexibility
and usability. Python's readability is showcased through the concise and expressive syntax used to
generate random characters from a defined set of letters, digits, and punctuation marks.

Moreover, the program's modular structure facilitates easy extension and modification, highlighting
Python's adaptability to evolving requirements. This flexibility is a hallmark of Python's design
philosophy, enabling developers to quickly prototype and iterate on solutions.

The program's user interaction, implemented through the input function, demonstrates Python's ability to
handle user input seamlessly. This aspect, coupled with the program's clear and concise output, enhances
the user experience.

Overall, the password generator exemplifies Python's suitability for a wide range of applications, from
simple scripts to complex software projects. Its intuitive design and efficient implementation make it an
excellent example of Python's effectiveness in solving real-world problems.

5|Page

You might also like