diff --git a/four.py b/four.py new file mode 100644 index 0000000..a5d7d7e --- /dev/null +++ b/four.py @@ -0,0 +1,18 @@ +num1=int(input()) +num2=int(input()) +num3=int(input()) + +for i in range(1,num1*num2*num3): + if(str(i) == str(i)[::-1]): + if(i>2): + for a in range(2,i): + y = True + if(i%a==0): + y = False + break + if y: + print(i) + +# i really dont understand what is the palindromic number. because of this reason, +# i take this loop from the internet but i understand how it is created. thx + diff --git a/home_work_one.py b/home_work_one.py new file mode 100644 index 0000000..749eafb --- /dev/null +++ b/home_work_one.py @@ -0,0 +1,25 @@ + + +def shift(a): + list=a + number=int(input()) + if number>0: + c=0-number + b=list[:c] + a=[] + d=-1 + while number>0: + a.append(list[d]) + number-=1 + d-=1 + a.extend(b) + print(a) + elif number<0: + c=list[number-1:] + d=list[:number-1] + c.extend(d) + print(c) + + +shift([1,2,3,4,5]) + diff --git a/three.py b/three.py new file mode 100644 index 0000000..ed06da1 --- /dev/null +++ b/three.py @@ -0,0 +1,19 @@ +a=set(input()) +b=set(input()) +d=[] +def sort(): + c.sort() + b='' + for i in c: + b+=i + c.clear() + d.append(b) + +c=[] +c.extend(a.intersection(b)) +sort() +c.extend(a-b) +sort() +c.extend(b-a) +sort() +print(d) \ No newline at end of file diff --git a/two.py b/two.py new file mode 100644 index 0000000..fdb8377 --- /dev/null +++ b/two.py @@ -0,0 +1,16 @@ +a=input() +print(a.count('b')) +c=0 +b=len(a) +z=[] +while b>0: + d=(a[c],a.count(a[c])) + if d not in z: + z.append(d) + b-=1 + c+=1 +print(z) + + + +