-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathModelPersonne.py
More file actions
37 lines (29 loc) · 787 Bytes
/
Copy pathModelPersonne.py
File metadata and controls
37 lines (29 loc) · 787 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
class Ssn:
def __init__(self, numeroSecu):
self.numeroSecu = numeroSecu
def is_valid(self):
b = int(self.numeroSecu[:-2]) % 97
c = 97 - b
# if c < 10:
# c = "0" + str(c)
# print(c)
key = int(self.numeroSecu[-2:])
print(key, c)
return c == int(self.numeroSecu[-2:])
class Person:
def __init__(self, nom, prenom, ssn):
self.prenom = prenom
self.nom = nom
self.ssn = ssn
def getNom(self):
return self.nom
def getPrenom(self):
return self.prenom
def getSSN(self):
return self.ssn
def has_valid_ssn(self):
ssn = Ssn("269054958815780")
if ssn.is_valid():
return True
else:
return False