full ver of programm
This commit is contained in:
parent
caec67a91b
commit
32684c12b5
38
main.py
38
main.py
@ -1,16 +1,28 @@
|
|||||||
#7-922-946-93-88
|
# 7-922-946-93-88
|
||||||
#8-922-946-93-88
|
# 8-922-946-93-88
|
||||||
#0-111-222-33-44
|
# +7 923 123 45 67
|
||||||
|
# 0-111-222-33-44
|
||||||
|
|
||||||
|
|
||||||
|
numbers = ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]
|
||||||
|
|
||||||
|
|
||||||
|
def validate_phone(phone: str) -> bool:
|
||||||
|
exit_str = ""
|
||||||
|
if phone[0] == "+":
|
||||||
|
return False
|
||||||
|
for s in phone:
|
||||||
|
if s in numbers:
|
||||||
|
exit_str += s
|
||||||
|
if exit_str[0] == "7" or exit_str[0] == "8":
|
||||||
|
if len(exit_str) == 11:
|
||||||
|
return True
|
||||||
|
|
||||||
|
return False
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
def check_1_part(part1):
|
print("89231234567", validate_phone("89231234567"))
|
||||||
|
print("8-923-123-45-67", validate_phone("8-923-123-45-67"))
|
||||||
def check_2_part(part2):
|
print("+79211234567", validate_phone("+79211234567"))
|
||||||
|
print("123456", validate_phone("123456"))
|
||||||
def check_3_part(part3):
|
|
||||||
|
|
||||||
def check_4_part (part4):
|
|
||||||
|
|
||||||
def main():
|
|
||||||
input(full_number)
|
|
||||||
Loading…
Reference in New Issue
Block a user