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

Commit 2786604

Browse files
authored
Add files via upload
1 parent 4469cdb commit 2786604

File tree

5 files changed

+49
-0
lines changed

5 files changed

+49
-0
lines changed

1_sum.py

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#Print the sum of numbers less than 500 which are divisible by 5 and not divisible by 7
2+
sum=0
3+
num=0
4+
for num in range(1,501):
5+
if num % 5==0 and num%7!=0:
6+
sum=sum+num
7+
8+
print sum

2_percent.py

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
l=6
2+
b=8
3+
h=10
4+
per=15/100
5+
li=l+l*per
6+
bi=b+b*per
7+
hi=h+h*per
8+
print "surface area:"
9+
print 2*(li*bi +bi*li +hi*bi)
10+
print "volume:"
11+
print li*bi*hi

3_sort.py

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
list1=["Ron","Hermione","Harry","Professor","Dobby","List Items 2","The House Elf","Potter","Granger","Lockhart","Weasley"]
2+
list2=["Potter","Fred","Greg","George","Voldemort","Sirius","Dumbledore","Potter","Fred","Greg","George"]
3+
list1.sort()
4+
for i in range(0,11):
5+
for j in range(0,11):
6+
str=list1[i]+list2[i]
7+
print str
8+
break

4_pytha.py

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
for a in range(0,1000):
2+
for b in range(0,1000):
3+
for c in range(0,1000):
4+
if a**2 + b**2==c**2 and a+b+c==1000:
5+
if a<b<c:
6+
print a*b*c
7+
exit()
8+
9+

7_pali.py

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
n=raw_input("Enter the String:")
2+
def palindrome(n):
3+
index=0
4+
check=True
5+
while index<len(n):
6+
if n[index]==n[-1-index]:
7+
index+=1
8+
return True
9+
return False
10+
if palindrome(n)==True:
11+
print "It is a Palindrome"
12+
else:
13+
print "It is not a Palindrome"

0 commit comments

Comments
 (0)