Advertisement
tokyoedtech

Split / Loop Practice

Feb 4th, 2017
189
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.89 KB | None | 0 0
  1. import os
  2. os.system("clear")
  3.  
  4. print ("Password Checker")
  5. print ("")
  6.  
  7. #Create a string of passwords and print it
  8. text = "miso2 3ant kawii! 8runner n3mui 5sushi"
  9. print (text)
  10. print("")
  11.  
  12. #Split the string at the space
  13. #Since it is a list of passwords, call the list passwords
  14.  
  15.  
  16. #Print how many passwords there are
  17.  
  18.  
  19. #Iterate through the list
  20. #Print each word on a separate line
  21.    
  22.  
  23. #Iterate through the list
  24. #Print the first letter of each password on a separate line
  25.  
  26.    
  27. #Create a function called isNumber to determine if a character is a number
  28. #Return True if it is a number
  29. #Otherwise, Return false
  30.  
  31.  
  32. #Iterate through the list.
  33. #Print the passwords that start with numbers only
  34. #Use the isNumber function you just created
  35.  
  36.  
  37. #Iterate through the list.
  38. #A valid password starts with a number and is longer than 5 characters
  39. #Print whether each password is valid, or invalid
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement