Login Register






[Python] Char Counter filter_list
Author
Message
[Python] Char Counter #1
Hey fellas! Here's one of my new tool and it might be handy to some of ya. This simple script calculates all the total number of characters in your password like:
How many symbols
How many alphabets
How many numbers

Here's the code:

Code:
def passint(): alp_count = 0 sym_count = 0 num_count = 0 symbols = (",./;[]=-`~!@#$%^&*()_+{}:?<>?"'') numbers = '0123456789' alpha = 'ABCEDFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz' for words in pswd: for items in symbols: if items in words: sym_count += 1 #else: #print('No Symbols') print('Number of symbols are: ',sym_count) for words in pswd: for items in numbers: if items in words: num_count += 1 print('Total numbers: ', num_count) for words in pswd: for items in alpha: if items in words: alp_count += 1 print('Total alphabets: ', alp_count) pswd = input('Enter your password: ') length = len(pswd) passint()

Task For Beginners:
Modify this script in such a way that it ask the user to input the location of a text file containing a paragraph(Lets Suppose) and then returns the output as what I've mentioned above.
My Blog: http://www.procurity.wordpress.com
Donations: 1HLjiSbnWMpeQU46eUVCrYdbkrtduX7snG

Reply