Advertisement
Guest User

Pesel

a guest
Jan 18th, 2020
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.91 KB | None | 0 0
  1. def check(pesel):
  2. if (len(pesel) !=11) & (pesel.isdigit == false):
  3. return False
  4.  
  5. return True
  6.  
  7. def cal(pesel):
  8. yearborn = pesel[:2]
  9. monthborn = pesel[3:5]
  10. dayborn = pesel[6:8]
  11.  
  12.  
  13. return yearborn, monthborn, dayborn
  14.  
  15.  
  16. def enter_pesel():
  17. name = str(input("Name: "))
  18. psl = str(input("Pesel: "))
  19. res = check(psl)
  20.  
  21. if res == False:
  22. print("Something goes wrong")
  23. if res == True:
  24. yb, mb, db = calc(psl)
  25.  
  26. print(name + "born on: " + db + "." + mb + "." + yb)
  27. print("PESEL: " + pesel)
  28.  
  29. def main():
  30. isRunning = True
  31.  
  32. while isRunning:
  33. print("[*] MENU")
  34. print("[*] 1 - Start script")
  35. print("[*] 0 - End script")
  36.  
  37. choice = input()
  38.  
  39. if choice == "0":
  40. isRunning = false
  41. break
  42.  
  43. else:
  44. continue
  45.  
  46. if __name__ == "__main__":
  47. main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement