Skip to content

Commit

Permalink
Merge pull request #152 from Shruti44328/main
Browse files Browse the repository at this point in the history
Add files via upload
  • Loading branch information
itsmedeepak authored Oct 16, 2022
2 parents 11c28a0 + fdb5a85 commit 233edb9
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions matrix/8.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Python3 code to demonstrate working of
# Vertical Concatenation in Matrix
# Using loop

# initializing lists
test_list = [["Gfg", "good"], ["is", "for"], ["Best"]]

# printing original list
print("The original list : " + str(test_list))

# using loop for iteration
res = []
N = 0
while N != len(test_list):
temp = ''
for idx in test_list:

# checking for valid index / column
try: temp = temp + idx[N]
except IndexError: pass
res.append(temp)
N = N + 1

res = [ele for ele in res if ele]

# printing result
print("List after column Concatenation : " + str(res))

0 comments on commit 233edb9

Please sign in to comment.