python_rag_system/lesson_1/code/login.py
2025-10-02 11:39:19 +03:00

35 lines
881 B
Python
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# int() str() bool()
# todo: Ввести type hinting.
# Написать валидацию входных значений.
# Обернуть это функцией
# В логине должна быть собачка @
LOGIN :str = "admin@mail.ru"
PASSWD :int = 123
def login_password_validation():
# todo:
login_ = input("Введите email:")
if not "@" in login_:
print("Error")
exit(100)
passwd_ = int(input("Введите пароль:"))
return login_, passwd_
l, p = login_password_validation()
print(l)
print(p)
def check_login_password():
#
login_, passwd_ = login_password_validation()
if ( LOGIN == login_ and PASSWD == passwd_ ):
print("Вы успешно вошли в систему!")
else:
print("Логин и пароль не совпадает!")
# check_login_password()