Answer to Question #285368 in Python for Ram

Question #285368

Perpendicular Words


Write a program to print all the perpendicular words in S.


sample input 1

CAT BAT VIN


sample output1

CBV

AAI

TTN


sample input 2

MAM BY DORM


sample output 2

MBD

AYO

M R

M



1
Expert's answer
2022-01-07T07:45:01-0500
inputString=input().split(' ')


wordMax=max(inputString,key=len)
for index in range(0,len(wordMax)):
    for word in inputString:
        if index<len(word):
            print(word[index],end="")
        else:
            print(" ",end="")
    print()

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS