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

Commit 83fe796

Browse files
authored
Add files via upload
1 parent 36481ca commit 83fe796

File tree

4 files changed

+57
-0
lines changed

4 files changed

+57
-0
lines changed

1_s57.py

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

3_acs.py

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
words1 = ['Ron','Hermione','Harry','Professor','Dobby']
2+
3+
4+
words.sort()
5+
6+
7+
print("The sorted words are:")
8+
9+
for word in words:
10+
11+
print(word)
12+
words2=['The House Elf','Potter','Granger','Lockhart','Weasley']
13+
mergedList = words1 + words2
14+
print(mergedList)

6_pn.py

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
lower = 900
2+
3+
upper = 1000
4+
5+
6+
7+
print("Prime numbers between",lower,"and",upper,"are:")
8+
9+
10+
11+
for num in range(lower,upper + 1):
12+
13+
14+
15+
if num > 1:
16+
17+
for i in range(2,num):
18+
19+
if (num % i) == 0:
20+
21+
break
22+
23+
else:
24+
25+
print(num)

7_pon.py

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
def is_palindrome(s):
2+
if len(s) < 1:
3+
return True
4+
else:
5+
if s[0] == s[-1]:
6+
return is_palindrome(s[1:-1])
7+
else:
8+
return False
9+
a=str(input("Enter string:"))
10+
if(is_palindrome(a)==True):
11+
print("String is a palindrome!")
12+
else:
13+
print("String isn't a palindrome!")

0 commit comments

Comments
 (0)