We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 6c1b748 commit 879ca6cCopy full SHA for 879ca6c
RegexandParsing/ValidatingCreditCardNumbers.py
@@ -17,7 +17,10 @@
17
length_16 = bool(re.match(r"^[4-6]\d{15}$", credit))
18
length_19 = bool(re.match(r"^[4-6]\d{3}-\d{4}-\d{4}-\d{4}$", credit))
19
consecutive = bool(re.findall(r"(?=(\d)\1\1\1)", credit_removed_hiphen))
20
- if (length_16 or length_19) and consecutive or not length_16 and not length_19:
+ if length_16 == True or length_19 == True:
21
+ if consecutive == True:
22
+ valid = False
23
+ else:
24
valid = False
25
if valid:
26
print("Valid")
0 commit comments