Question: Write a program that takes a string as an input ( 3 p ) , splits the string in half ( 8 p ) ,

Write a program that takes a string as an input (3p), splits the string in half (8p), puts it back together in
reverse order (8p), and prints the result (3p). If the string has an odd number of characters, then the
first "half" should be the shorter one. For example, "nowhere") should print "herenow". Name the file as
p4.py and make sure to write your name as a comment and use comments to describe the statements
(4p).
Hints:
1. You can use the len() function to find the length of the input string.
2. You can use string sequences and indexes to reverse the input.
3. You can use + as a concatenation operator to combine characters or strings.p4.py and make sure to write your name as a comment and use comments to describe the statements
(4p).
Hints:
1. You can use the len() function to find the length of the input string.
2. You can use string sequences and indexes to reverse the input.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!