Skip to content
This repository was archived by the owner on Sep 20, 2024. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions 1_div.py
Original file line number Diff line number Diff line change
@@ -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))

7 changes: 7 additions & 0 deletions 2_arealb.py
Original file line number Diff line number Diff line change
@@ -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)
6 changes: 6 additions & 0 deletions 3_sort.py
Original file line number Diff line number Diff line change
@@ -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)
12 changes: 12 additions & 0 deletions 6_prime.py
Original file line number Diff line number Diff line change
@@ -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)


13 changes: 13 additions & 0 deletions 7_palindrome.py
Original file line number Diff line number Diff line change
@@ -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")