Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- IC = str(input("Enter the IC to be validated: "))
- temp1 = int(IC[1])
- temp2 = int(IC[2])
- temp3 = int(IC[3])
- temp4 = int(IC[4])
- temp5 = int(IC[5])
- temp6 = int(IC[6])
- temp7 = int(IC[7])
- a = temp1 * 2
- b = temp2 * 7
- c = temp3 * 6
- d = temp4 * 5
- e = temp5 * 4
- f = temp6 * 3
- g = temp7 * 2
- total_of_multiplication = int(a + b + c + d + e + f + g)
- total_add4 = int(total_of_multiplication + 4)
- remainder = int(total_add4 % 11)
- index = remainder.replace(0,"J").replace("1","Z").replace("2","I").replace("3","H").replace("4","G").replace("5","F").replace("6","E").replace("7","D")
- index2 = index.replace("8","C").replace("9","B").replace("10","A")
- lastletterofIC = str(IC[8])
- if index2 == lastletterofIC:
- print("Validity of the IC: True")
- else:
- print("False")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement