Answer to Question #227203 in Python for kaavya

Question #227203

Half String - 2

Write a program that prints the second half of the given input string.

You can assume that the length of the input string will always be an even number.

Input

The first line of input is a string.

Output

The output should be a string.

Explanation

In the given string

messages, the length of the string is 8. The last 4 characters i.e The second half of the string is ages. So the output should be

ages.

Sample Input 1

messages

Sample Output 1

ages

Sample Input 2

time

Sample Output 2

me




1
Expert's answer
2021-08-20T01:09:15-0400
string1 = input('Enter string with its length as even number: ')
n = int(len(string1)/2)
string2 = string1[n:]
print(string2)

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