Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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.image text in transcribed

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Fundamentals Of Database Systems

Authors: Sham Navathe,Ramez Elmasri

5th Edition

B01FGJTE0Q, 978-0805317558

More Books

Students also viewed these Databases questions