CPR Number

This commit is contained in:
2023-06-26 13:54:42 +02:00
parent 422eff3a2f
commit b2fd768c1c

14
cprnummer.py Normal file
View File

@@ -0,0 +1,14 @@
cpr = list(map(int, input().strip().replace("-", "")))
valid = (
cpr[0] * 4
+ cpr[1] * 3
+ cpr[2] * 2
+ cpr[3] * 7
+ cpr[4] * 6
+ cpr[5] * 5
+ cpr[6] * 4
+ cpr[7] * 3
+ cpr[8] * 2
+ cpr[9] * 1
) % 11 == 0
print(1 if valid else 0)