Create 2.py
This commit is contained in:
parent
4342aad111
commit
9e611363ce
17
15/b/2.py
Normal file
17
15/b/2.py
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
def check(S):
|
||||||
|
if len (S.replace(" ", "")) != 16:
|
||||||
|
return False
|
||||||
|
for i in range(len(S)):
|
||||||
|
if i%5==4:
|
||||||
|
if S[i] != " ":
|
||||||
|
return False
|
||||||
|
else:
|
||||||
|
if not S[i].isdigit():
|
||||||
|
return False
|
||||||
|
|
||||||
|
x = 0
|
||||||
|
for i in S.replace(" ", ""):
|
||||||
|
x += int(i)
|
||||||
|
if not x%10:
|
||||||
|
return True
|
||||||
|
return False
|
Loading…
Reference in New Issue
Block a user