Skip to content

Commit c62b3c9

Browse files
authored
Add files via upload
1 parent a07eec8 commit c62b3c9

File tree

3 files changed

+32
-0
lines changed

3 files changed

+32
-0
lines changed
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
def divide_chunks(l,N):
2+
for i in range(0,len(l),N):
3+
yield l[i:i+N]
4+
5+
n = int(input("Enter the size of list : "))
6+
print("\n")
7+
list1 = list(map(float, input("Enter the list numbers separated by space ").strip().split()))[:n]
8+
print("User List: ", list1)
9+
N=int(input("Enter The size"))
10+
11+
x= list(divide_chunks(list1,N))
12+
print(x)

Cumalative sum of a list.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
n = int(input("Enter the size of list : "))
2+
print("\n")
3+
list1 = list(map(float, input("Enter the list numbers separated by space ").strip().split()))[:n]
4+
print("User List: ", list1)
5+
list2=[]
6+
j=0
7+
for i in range(len(list1)):
8+
j+=list1[i]
9+
list2.append(j)
10+
11+
print(list2)

Duplicates from a list.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
from collections import Counter
2+
3+
n = int(input("Enter the size of list : "))
4+
print("\n")
5+
list1 = list(map(float, input("Enter the list numbers separated by space ").strip().split()))[:n]
6+
print("User List: ", list1)
7+
8+
d= Counter(list1)
9+
print(d)

0 commit comments

Comments
 (0)