Posts

Showing posts with the label pythontutorial

Python Program to Make a Simple Password Saver

Image
In this example program, we are building a python program to safely store and retrieve the password. It stores passwords in a file. Passwords are totally secured. This program also contains a master password to use the application. Option available in the program is you can get previously-stored password. You can also add your new password. You can also check for all stored usernames. So let's start writing Python Program to build a Simple Password Saver. Note:  This program is not a fully secure program to store your important passwords. This is just an idea to create one, you can make some modifications and suggestions to us via comments.  Algorithm Upon Entry validity of user is checked by a master password, which is currently hardcoded as (rahulkumar). If validated then we enter into an endless while loop which will show you menu to do various things. If validation failed error message will be shown and program exits. we will be store all passwords as key and value pairs....

Bubble sort in Python Language

Image
Bubble sort is the simplest Sorting algorithm available. It works by repeatedly swapping the adjacent or neighbor element if they are in the wrong order. Working Actually in the first-pass bubble sort sets the largest element to its position, in the second pass algorithm sets the second largest element this continues till the list or array is not finally sorted. Here is the example image. To work with the algorithm you first have to understand what is swapping and how it is done. What is Swapping ?? Swapping is a technique to interchange the content of the two variables, using another variable called a temporary variable. In python programming language swapping works in two ways, both of them are shown below. For the program in Python arr = [64, 34, 25, 12, 22, 11, 90] n = len(arr) for i in range(n): # Last i elements are already in place for j in range(0, n-i-1): # traverse the array from 0 to n-i-1 # Swap if the element found is greater # than the next element if ...