AD1

Friday, 22 December 2017

Reverse words in a given string

Problem

https://practice.geeksforgeeks.org/problems/reverse-words-in-a-given-string/0

Solution

#problem link
# https://practice.geeksforgeeks.org/problems/reverse-words-in-a-given-string/0
#code
T=int(input())#Test cases
for t in range(0,T):#looping through all test cases
string=[x for x in input().split(".")]
print(*string[::-1],sep='.')
view raw T1.py hosted with ❤ by GitHub
 

No comments:

Post a Comment