"The two halves: Given a string. Cut it into two "equal" parts (If the length of the string is odd, place the center character in the first string, so that the first string contains one more characther than the second). Now print a new string on a single row with the first and second halfs interchanged (second half first and the first half second) " - Snakify python coding question

 



 

CODING QUESTION

Given a string. Cut it into two "equal" parts (If the length of the string is odd, place the center character in the first string, so that the first string contains one more characther than the second). Now print a new string on a single row with the first and second halfs interchanged (second half first and the first half second)

Don't use the statement if in this task.


SOLUTION

from math import*
s=str(input())
print(s[ ceil(len(s)/2): ], s[:(ceil(len(s)/2))],sep='')

 

Input : Hi

Output : iH