Question: Set a constant with an odd length string. Confirm in code that the string is of an odd length. Otherwise, print a relevant message

Set a constant with an odd length string. Confirm in code that the string is of an odd length. Otherwise, print a relevant message for the user and end the program. For a string of odd length, print each of the following in double quotes: < Print the entire string and its length. Print the middle character. < Print the string up to but not including the middle character. < Print the string from immediately following the middle character to the end. < Example of Output: My 27 character string is: "A man a plan a canal Panama" The middle character is: "a" The 1st half of string is: "A man a plan " The 2nd half of string is: canal Panama"
Step by Step Solution
3.37 Rating (150 Votes )
There are 3 Steps involved in it
Python version 36 Python program to perform operation on an oddlength string set a constan... View full answer
Get step-by-step solutions from verified subject matter experts
