You are given two strings as input. Write a program to print the given two strings in reverse order separated by "---".
The first and second line of input are strings.
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
string = "Apple --- Banana"
words = string.split()
words = list(reversed(words))
print("\n" .join(words))
Comments
Leave a comment