Question: Write a Python code Given a string as input, you have to reverse the string by keeping the punctuation and spaces intact, i.e., the position
Write a Python code

Given a string as input, you have to reverse the string by keeping the punctuation and spaces intact, i.e., the position of the punctuation and spaces should not change even after reversing, but the positions of characters, numbers will change after reversing. You have to modify the source string itself without creating another string. Input: A single line contains the input line Output: A single line in reversed order keeping the punctuation and spaces intact. Constraint: O
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
