full ver of programm

This commit is contained in:
Роман Бортников 2026-04-18 13:47:40 +03:00
parent caec67a91b
commit 32684c12b5

24
main.py
View File

@ -1,16 +1,28 @@
# 7-922-946-93-88 # 7-922-946-93-88
# 8-922-946-93-88 # 8-922-946-93-88
# +7 923 123 45 67
# 0-111-222-33-44 # 0-111-222-33-44
numbers = ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]
def check_1_part(part1):
def check_2_part(part2): 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
def check_3_part(part3): return False
def check_4_part (part4):
def main():
input(full_number) print("89231234567", validate_phone("89231234567"))
print("8-923-123-45-67", validate_phone("8-923-123-45-67"))
print("+79211234567", validate_phone("+79211234567"))
print("123456", validate_phone("123456"))