Solve problem "The two halves" online - Learn Python 3 - Snakify

Problem «The two halves» (Easy)


Statement

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.


In all the problems input the data using input() and print the result using print().



Saved solutions

Tests

Input Correct answer Result
Hi
iH
Hello
loHel
Qwerty
rtyQwe
Z
Z
asdfghj
ghjasdf
asdfghjzxc
hjzxcasdfg