Skip to content

Commit 624a1cd

Browse files
authored
Add files via upload
1 parent 063a144 commit 624a1cd

File tree

5 files changed

+40
-0
lines changed

5 files changed

+40
-0
lines changed

Week 2/SET 14 -Week 2/ques1.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
def ispangram(str):
2+
alphabet = "abcdefghijklmnopqrstuvwxyz"
3+
for char in alphabet:
4+
if char not in str.lower():
5+
return False
6+
7+
return True
8+
9+
str = input("enter a sentence :\n ")
10+
if ispangram(str):
11+
print('contains all alphabets')
12+
else:
13+
print('does not contain all alphabets')

Week 2/SET 14 -Week 2/ques2.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
arr = tuple(map(int,input().split()))
2+
3+
adderp = sum(list(filter(lambda x: (x>= 0) , arr)))
4+
addernp = sum(list(filter(lambda x: (x<0) , arr)))
5+
6+
print(adderp)
7+
print(addernp)
8+

Week 2/SET 14 -Week 2/ques3.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
arr = [int(x) for x in input().split()]
2+
test_list = list(set(arr))
3+
print(test_list)

Week 2/SET 14 -Week 2/ques4.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
tuple1 = tuple(map(int,input().split()))
2+
tuple2 = tuple(map(int,input().split()))
3+
tuple3 = tuple(map(int,input().split()))
4+
5+
adder = tuple(map(lambda x, y, z: (x + y + z)//3, tuple1, tuple2, tuple3))
6+
7+
print(adder)
8+

Week 2/SET 14 -Week 2/ques5.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
my_dict = {1:'Apple', 2:'Oracle',3:'Advanced Programming Practice',4:'Software Project Management', 5:'Fundamentals of mathematics'}
2+
3+
for x in range(1,6):
4+
#print(my_dict[i])
5+
test_str = my_dict[x]
6+
res = {i : test_str.count(i) for i in set(test_str)}
7+
print(res)
8+

0 commit comments

Comments
 (0)