CBSE Class 11 Computer Science Question 7 of 21

String Manipulation — Question 13

Back to all questions
13
Question

Question 7a

Find the output if the input string is 'Test'.

S = input("Enter String :")
RS = " "
for ch in S :
    RS = ch + RS
print(S + RS)
Answer
Output
TesttseT
Explanation

The for loop reverses the input string and stores the reversed string in variable RS. After that original string and reversed string are concatenated and printed.

Get the Bright Tutorials app Stuck on a question? Ask Bright Buddy — your AI tutor — for step-by-step help in the app.