From 092510eaab4943d0b4230fad1d2fc9e666b7b4f8 Mon Sep 17 00:00:00 2001 From: shivaninayakam <31064338+shivaninayakam@users.noreply.github.com> Date: Sun, 18 Mar 2018 04:20:21 -0400 Subject: [PATCH 1/5] Create 1_div.py --- 1_div.py | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 1_div.py diff --git a/1_div.py b/1_div.py new file mode 100644 index 0000000..6ac2262 --- /dev/null +++ b/1_div.py @@ -0,0 +1,10 @@ +n=500 +flag=0 +sum=0 +for i in range(1,n): + if((i%5==0)and(i%7!=0)): + flag=1 + sum=sum+i +if(flag==1): + print(int(sum)) + From 8adeeaa0fca5540364aedfc838c6667829cfb29a Mon Sep 17 00:00:00 2001 From: shivaninayakam <31064338+shivaninayakam@users.noreply.github.com> Date: Sun, 18 Mar 2018 04:21:19 -0400 Subject: [PATCH 2/5] Create 2_arealb.py --- 2_arealb.py | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 2_arealb.py diff --git a/2_arealb.py b/2_arealb.py new file mode 100644 index 0000000..f1d348c --- /dev/null +++ b/2_arealb.py @@ -0,0 +1,7 @@ +l=6 +b=8 +h=10 +inl=l+0.15*l +inb=b+0.15*b +a=inl*inb +print(a) From b8ea22a3371f22d9e499544b3ff97b7736e9d088 Mon Sep 17 00:00:00 2001 From: shivaninayakam <31064338+shivaninayakam@users.noreply.github.com> Date: Sun, 18 Mar 2018 04:22:47 -0400 Subject: [PATCH 3/5] Create 3_sort.py --- 3_sort.py | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 3_sort.py diff --git a/3_sort.py b/3_sort.py new file mode 100644 index 0000000..81b7e03 --- /dev/null +++ b/3_sort.py @@ -0,0 +1,6 @@ +list1=["Ron","Hermione","Harry","Professor","Dobby"] +list2=["The House Elf","Potter","Granger","Lockhart","Weasely"] +def concat(list1,list2): + return(sorted(list1)+sorted(list2)) +list3=concat(list1,list2) +print(list3) From 6131c13f974b7ccfe9f1e15d783864246dbe7b4f Mon Sep 17 00:00:00 2001 From: shivaninayakam <31064338+shivaninayakam@users.noreply.github.com> Date: Sun, 18 Mar 2018 04:23:45 -0400 Subject: [PATCH 4/5] Create 6_prime.py --- 6_prime.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 6_prime.py diff --git a/6_prime.py b/6_prime.py new file mode 100644 index 0000000..b237dcb --- /dev/null +++ b/6_prime.py @@ -0,0 +1,12 @@ +n=1000000 +i=1 +j=1 +for i in range(1,n): + count=0 + for j in range(1,n): + if i%j==0: + count+=1 + if count==2: + print(i) + + From 20d51ae9c2595f4c16543cbf71ae267a59857b22 Mon Sep 17 00:00:00 2001 From: shivaninayakam <31064338+shivaninayakam@users.noreply.github.com> Date: Sun, 18 Mar 2018 04:24:25 -0400 Subject: [PATCH 5/5] Create 7_palindrome.py --- 7_palindrome.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 7_palindrome.py diff --git a/7_palindrome.py b/7_palindrome.py new file mode 100644 index 0000000..c1696f7 --- /dev/null +++ b/7_palindrome.py @@ -0,0 +1,13 @@ +i=0 +flag=0 +s1=input("enter string") +n=len(s1) +for i in range(1,n): + if(s1[i]!=s1[n-i-1]): + flag=1 + break +if(flag==1): + print("string is not palindrome") +else: + print("string is palindrome") +