Advertisement
furas

Python - wrong password #4

Mar 21st, 2017
194
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.71 KB | None | 0 0
  1. wrongpasswordlist = []
  2.  
  3. number = 1
  4.  
  5. while True:
  6.     userpassword = raw_input("enter your password ")
  7.  
  8.     if userpassword == "j":
  9.         print "This is the correct password"
  10.         print "this was your wrong passwords", wrongpasswordlist
  11.         break
  12.  
  13.     print "wrong password nmr", number
  14.     number += 1
  15.     wrongpasswordlist.append(userpassword)
  16.  
  17.  
  18.  
  19. ofile = open('wrongpasswords.txt', 'w')
  20.  
  21. for number, password in enumerate(wrongpasswordlist, 1):
  22.     #ofile.write('wrong password nmr {} "{}"\n'.format(number, password))
  23.     #ofile.write('wrong password nmr %d "%s"\n' % (number, password))
  24.     ofile.write('wrong password nmr ' + str(number) + '"' + password + '"\n')
  25.    
  26. ofile.close()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement