Answer to Question #218757 in Python for Ravichandrasekhar

Question #218757

You are given two strings as input. Write a program to print the given two strings in reverse order separated by "---".

Input

The first and second line of input are strings.

Explanation

In the example, the given strings are

Apple, Banana. So now we have to reverse the order of strings to Banana, Apple and add a separation line between the two strings.So the output should be


Banana

---

Apple




1
Expert's answer
2021-07-19T17:02:55-0400
string = "Apple  ---  Banana"
words = string.split()
words = list(reversed(words))
print("\n"  .join(words))

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