Question: 2. Write a program that reads a string and prints the reversal. You should define a function called reverse() that computes the reversal of a

2. Write a program that reads a string and prints the reversal. You should define a function called reverse() that computes the reversal of a string using a loop. For this programming exercise you are not allowed to reverse a string using [::-1]. The input of the program (function) is a string s. For example: reverse(Python is fun!) should return the string !nuf si nohtyP reverse(Texas Aggies) should return the string seiggA saxeT reverse(Reveille) should return the string ellieveR Notes: len(s) is a function that returns the numbers of caracteres of the string. Strings do not support item assignment, so you cant do this: s[i] = a. You can use operations like concatenation to solve your problem.2. Write a program that reads a string and prints the reversal.

by the way this has to be done in python

Example #1. Python is fun! Enter the string Python is Fun! Reverse string: !nuF si nohtvP Example #2. n= 1000. 1Enter the string Texas Aggies Reverse string: sei88A saxeT

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 Databases Questions!