Question: Problem Description = = = = = = = = = = = = = = = = = = = = Design and implement

Problem Description
====================
Design and implement a program that asks the user to enter a string, reverses
the string, and prints both the original string and the reversed string.
You cannot use any built-in string method or anything we haven't discussed in this
class for this program. (20 pts). Use 'my_str' as the name of the user input variable.
Use string concatenation instead of f-string.
Input:
Enter a string: pop
output:
Original string: pop
Reversed string: pop
Input:
Enter a string: map top
output:
Original string: map top
Reversed string: pot pam
"""
# Write your code below this line
my_str = input("Enter a string: ")
reversed_str = my_str[::-1]
print("Original string: "+ my_str)
print("Reversed string: "+ reversed_str)

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!