Skip to content
This repository was archived by the owner on Sep 20, 2024. It is now read-only.

Commit a947c46

Browse files
authored
Merge pull request #26 from MRUDULA18/master
Verified
2 parents 7b3b4df + 29c685a commit a947c46

File tree

7 files changed

+50
-0
lines changed

7 files changed

+50
-0
lines changed

1_sum

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
sum=0
2+
for m in range(1,500):
3+
if(m%5==0 and m%7!=0):
4+
sum=sum+m
5+
print (sum)

2_area

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
l,b,h=6,8,10
2+
l=(l*1.15)
3+
b=(b*1.15)
4+
h=(h*1.15)
5+
surface_area=2*(l*b+b*h+l*h)
6+
print(surface_area)

3_concact

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
l1=['Ron','Hermione','Harry','Professor','Dobby','List Items 2','The House Elf','Potter','Granger','Lockhart','Weasley']
2+
l2=['Potter','Fred','Greg','George','Voldemort','Sirius','Dumbledore']
3+
l3=sorted(l1)
4+
print(l2+l3)

4_pythagorean

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
for x in range(1,1000):
2+
for y in range(x+1,1000):
3+
z=1000-(x+y)
4+
if(x**2)+(y**2)==(z**2):
5+
if x+y+z==1000:
6+
print(x*y*z)
7+
break

5_small

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
def gcd(x,y):
2+
while y:
3+
x,y=y,x%y
4+
return x
5+
6+
def lcm(x,y):
7+
return (x*y)//gcd(x,y)
8+
9+
m=1
10+
for i in range(2,21):
11+
m=lcm(m,i)
12+
print(m)

6_prime

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
m=100
2+
l=1
3+
for a in range(l,m+1):
4+
if a>1:
5+
k=0
6+
for i in range(2,a//2+1):
7+
if(a%i==0):
8+
k=k+1
9+
if(k<=0):
10+
print(a)

7_palindrome

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
s1=input("enter string:")
2+
s1_rev=(s1[::-1])
3+
if(s1==s1_rev):
4+
print(" it is a palindrome")
5+
else:
6+
print(" it is not a palindrome")

0 commit comments

Comments
 (0)