Advertisement
Guest User

Untitled

a guest
Jun 25th, 2019
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.56 KB | None | 0 0
  1. def regras():
  2. print("A password deve ter as seguintes regras: n")
  3. print("d1: Apenas 1 maiuscula")
  4. print("d3: Deve usar 2 do set [! # - * + & % @ _] ")
  5. print("d5: Apenas 1 digito")
  6. print("d6: Começar por uma Letra n")
  7. print("E não pode: n")
  8. print("x2: Começar por um caracter especial ")
  9. print("x3: Usar caracteres fora do set [a-z A-Z 0-9 ' '] + [! # - * + & % @ _] ")
  10.  
  11. print_regras = regras()
  12. print (" ")
  13.  
  14. numero_aluno = input("Insira o número de aluno: ")
  15. Password = input("Insira uma password: ")
  16.  
  17. def check_maiusculas(input):
  18. maiusculas = 0
  19. lista_maiusculas = "A B C D E F G H I J K L M N O P Q R S T U V W X Y Z".split()
  20. for char in input:
  21. if char in lista_maiusculas:
  22. maiusculas += 1
  23. if maiusculas == 1:
  24. return True
  25. else:
  26. return False
  27.  
  28. def check_set(input):
  29. set = 0
  30. lista_set = "! # - * + & % @ _".split()
  31. for char in input:
  32. if char in lista_set:
  33. set += 1
  34. if set == 2:
  35. return True
  36. else:
  37. return False
  38.  
  39. def check_numeros(input):
  40. numeros = 0
  41. lista_numeros = "1 2 3 4 5 6 7 8 9 0".split()
  42. for char in input:
  43. if char in lista_numeros:
  44. numeros += 1
  45. if numeros == 1:
  46. return True
  47. else:
  48. return False
  49.  
  50. def check_comecarletra(input):
  51. comecarletra = 0
  52. lista_letra = "A-Z"[0] or "a-z"[0].split()
  53. for char in input:
  54. if char in comecarletra:
  55. comecarletra +=1
  56. if comecarletra == str("A-Z") or comecarletra == str("a-z"):
  57. return True
  58. else:
  59. return False
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement