From 0ac1e8ed5a67ae7b0df929e02bf49ca123d9abbd Mon Sep 17 00:00:00 2001 From: SaiduHephzibah <30544873+SaiduHephzibah@users.noreply.github.com> Date: Sun, 18 Mar 2018 09:50:36 +0530 Subject: [PATCH 1/4] set1-multiples and set-2 palindrome --- multiples.py | 7 +++++++ palindrome.py | 7 +++++++ 2 files changed, 14 insertions(+) create mode 100644 multiples.py create mode 100644 palindrome.py diff --git a/multiples.py b/multiples.py new file mode 100644 index 0000000..a820748 --- /dev/null +++ b/multiples.py @@ -0,0 +1,7 @@ +def Multiples(n): + res = 0 + for i in range(5, n, 5): + if(i%7 !=0): + res+=i + print("\n",res ) +Multiples(500) \ No newline at end of file diff --git a/palindrome.py b/palindrome.py new file mode 100644 index 0000000..111141b --- /dev/null +++ b/palindrome.py @@ -0,0 +1,7 @@ +strng=str(input('Enter the string\n')) +strng_rev=str(strng[::-1]) + +if(strng == strng_rev): + print("palindrome") +else: + print("not a palindrome") \ No newline at end of file From 9b8fce7d484fb2d53294b7cd3a02738f04e9379c Mon Sep 17 00:00:00 2001 From: SaiduHephzibah <30544873+SaiduHephzibah@users.noreply.github.com> Date: Sun, 18 Mar 2018 11:08:59 +0530 Subject: [PATCH 2/4] Add files via upload --- 2_area.py | 8 ++++++++ 6_prime.py | 13 +++++++++++++ 2 files changed, 21 insertions(+) create mode 100644 2_area.py create mode 100644 6_prime.py diff --git a/2_area.py b/2_area.py new file mode 100644 index 0000000..7eb9b5b --- /dev/null +++ b/2_area.py @@ -0,0 +1,8 @@ +def area(incper,x,y,z): + inc=incper/100 + x=x+x*inc + y=x+y*inc + area=(x)*(y) + print(area) +area(15,6,8,10) + diff --git a/6_prime.py b/6_prime.py new file mode 100644 index 0000000..9a9f96d --- /dev/null +++ b/6_prime.py @@ -0,0 +1,13 @@ +lower = int(input("Enter lower range: ")) +upper = int(input("Enter upper range: ")) + +print("Prime numbers between",lower,"and",upper,"are:") + +for num in range(lower,upper + 1): + + if num > 1: + for i in range(2,num): + if (num % i) == 0: + break + else: + print(num) \ No newline at end of file From b62f545877cd6554be4e5a7b87c9bc063e419b1a Mon Sep 17 00:00:00 2001 From: SaiduHephzibah <30544873+SaiduHephzibah@users.noreply.github.com> Date: Sun, 18 Mar 2018 11:09:24 +0530 Subject: [PATCH 3/4] Rename multiples.py to 1_multiples.py --- multiples.py => 1_multiples.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) rename multiples.py => 1_multiples.py (81%) diff --git a/multiples.py b/1_multiples.py similarity index 81% rename from multiples.py rename to 1_multiples.py index a820748..a725909 100644 --- a/multiples.py +++ b/1_multiples.py @@ -4,4 +4,4 @@ def Multiples(n): if(i%7 !=0): res+=i print("\n",res ) -Multiples(500) \ No newline at end of file +Multiples(500) From e43e4a960e7fc9bd738497e5353ccca6f3707e5d Mon Sep 17 00:00:00 2001 From: SaiduHephzibah <30544873+SaiduHephzibah@users.noreply.github.com> Date: Sun, 18 Mar 2018 11:10:26 +0530 Subject: [PATCH 4/4] Rename palindrome.py to 7_palindrome.py --- palindrome.py => 7_palindrome.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) rename palindrome.py => 7_palindrome.py (77%) diff --git a/palindrome.py b/7_palindrome.py similarity index 77% rename from palindrome.py rename to 7_palindrome.py index 111141b..ba3798e 100644 --- a/palindrome.py +++ b/7_palindrome.py @@ -4,4 +4,4 @@ if(strng == strng_rev): print("palindrome") else: - print("not a palindrome") \ No newline at end of file + print("not a palindrome")