From d65e6e77ab364b1209153038d348b0d0762cba0e Mon Sep 17 00:00:00 2001 From: shariik Date: Tue, 16 Dec 2025 11:40:13 +0500 Subject: [PATCH] =?UTF-8?q?=D0=97=D0=B0=D0=B4=D0=B0=D0=BD=D0=B8=D0=B5=206?= =?UTF-8?q?=20=D0=BF=D0=B0=D1=80=D0=B0=D0=B3=D1=80=D0=B0=D1=84=203.1=20?= =?UTF-8?q?=D1=81=D0=B4=D0=B5=D0=BB=D0=B0=D0=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 3.1_lesson.6.20.py | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 3.1_lesson.6.20.py diff --git a/3.1_lesson.6.20.py b/3.1_lesson.6.20.py new file mode 100644 index 0000000..0aef856 --- /dev/null +++ b/3.1_lesson.6.20.py @@ -0,0 +1,19 @@ +***Задание 2 Параграф 3.1*** +***Напишите программу, которая определяет, относится ли введённая строка к палиндромам.*** + +if name == "main": + # Классическое сравнение + + string = input() + + palindrome = True + + for pos in range(len(string) // 2): + if string[pos] != string[~pos]: + palindrome = False + break + + if palindrome: + print('YES') + else: + print('NO') \ No newline at end of file