Question: use Python Input a string, reverse the string and insert commas between each character to output, for example Input: The first line at the beginning
use Python
Input a string, reverse the string and insert commas between each character to output, for example
Input:
The first line at the beginning represents the number of test data. Next, input "Orange", first reverse to "egnarO", insert commas "e,g,n,a,r,O" in the middle.
Note 1: For the read-in string, the last character is ' ' (please judge the last character so that it is not in the loop) Note 2: The output string should not have a comma at the end (please judge the last character and don't add a comma)
| input | output |
| 2 | e,g,n,a,r,O |
| Orange | .,k,o,o,b, ,a, ,s,i, ,s,i,h,T |
| This is a book. |
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
