Skip to content

Commit 5c18501

Browse files
committed
Cleaning CNPJ script
1 parent 5db241b commit 5c18501

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

Problem Solving Scripts/CNPJ_Checker.py

+1-4
Original file line numberDiff line numberDiff line change
@@ -70,9 +70,6 @@ def validateCNPJ(userCNPJ):
7070
userCNPJ = re.sub("[^0-9]", "", userCNPJ)
7171
logThis(userCNPJ)
7272

73-
# pick the last 2 digits of userCNPJ.
74-
last2digits = userCNPJ[-2:]
75-
7673
# Check length of CNPJ
7774
if len(userCNPJ) != 14:
7875
validCNPJ = False
@@ -86,7 +83,7 @@ def validateCNPJ(userCNPJ):
8683
sumOfDigits = sum(int(i) for i in userCNPJList)
8784
sumOfDigits = str(sumOfDigits)
8885

89-
# Get first nine digits from userCNPJ
86+
# Get first 12 digits from userCNPJ
9087
firstTwelveDigits = userCNPJList[0:12]
9188

9289
# Let's find the first last digit with this operation.

0 commit comments

Comments
 (0)