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
6 changes: 6 additions & 0 deletions 1_sum
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
sum=0;
for i in range(1,501):
if((i%5==0)and(i%7!=0)):
sum+=i;

print (sum);
3 changes: 3 additions & 0 deletions 2_area
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
l=6;b=8;h=10;
a=(6*1.15*8*1.15*10*1.15);
print (round(a,2));
4 changes: 4 additions & 0 deletions 3_alpha
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
set1=["Ron","Hermione","Harry","Professor","Dobby"];
set2=["The House Elf","Potter","Granger","Lockhart","Weasley"];
set1.sort();
print (set2+set1);
6 changes: 6 additions & 0 deletions 4_triplet
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
for a in range(1, 1000):
for b in range(a, 1000):
c = 1000 - a - b #as
if c*c == a*a + b*b:
print (a*b*c)
break
15 changes: 15 additions & 0 deletions 5_lcm
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
def gcd(a, b):

while b:
a, b = b, a % b
return a

def lcm(a, b):

return a * b // gcd(a, b)

x=1;

for num in range(1,21):
x=lcm(x,num);
print(x);
8 changes: 8 additions & 0 deletions 6_prime
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
for number in range(1,100000+1):


for i in range(2,number):
if (number % i) == 0:
break
else:
print(number)
6 changes: 6 additions & 0 deletions 7_palindrome
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
string1=input('enter the string\n'); #asking user for input
string2=string1[::-1]; #reversing the string
if(string1==string2): #checking if they're equal
print('entered string is palindrome');
else:
print('entered string is not a palindrome');