diff --git a/homework/2/8_1.py b/homework/2/8_1.py new file mode 100644 index 0000000..2f8e05f --- /dev/null +++ b/homework/2/8_1.py @@ -0,0 +1,10 @@ +from math import * + +# x = input().split() +a = input() +for i in range(floor(len(a)/2)): + if(a[i]!=a[len(a)-i-1]): + print("False") + exit() + +print("True") diff --git a/homework/2/8_2.py b/homework/2/8_2.py new file mode 100644 index 0000000..302f517 --- /dev/null +++ b/homework/2/8_2.py @@ -0,0 +1,5 @@ +s = input() +if (s == s[::-1]): + print("True") +else: + print("False") diff --git a/homework/2/9.py b/homework/2/9.py new file mode 100644 index 0000000..385f962 --- /dev/null +++ b/homework/2/9.py @@ -0,0 +1,5 @@ +x = list(map(int,input().split())) +x.sort() +a = x[0] +b = x[1] +print(round((a+b)*(b-a+1)/2)) \ No newline at end of file