1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Schach [20]
3 years ago
15

Write a function called ReverseLetters that takes an input phrase consisting of a single word and reverses the sequence of lette

rs between the first letter and last letter. The input phrase could be a character vector of any length.
Computers and Technology
1 answer:
ad-work [718]3 years ago
4 0

Answer:

# The function reverseLetter is defined

def reverseLetter(received_word):

   # The first letter of the word is assigned to a variable using index 0

   firstLetter = received_word[0]

   # The last letter of the word is assigned to a variable using index of

   # string length - 1

   lastLetter = received_word[len(received_word) - 1]

   # reverse letters in between first and last letter is defined as

  # empty string

   reverseBetween = ""

   # A counter is defined to control the loop during the reversal

   # counter value is 2 from the length of the received string

   # The 2 is for the first and last letter remove

   counter = len(received_word) - 2

   # The while loop start

   while counter >= 1:

       # The reverseBetween string is concatenated with corresponding

      # index of received word

       # The index is from high to low since the process is string reversal

       reverseBetween += received_word[counter]

       # The value of counter is decremented

       counter -= 1

   # The reversed string is displayed with no separator

   print(firstLetter, reverseBetween, lastLetter, sep="")    

Explanation:

The code is well commented.

reverseLetter("come") will output cmoe

reverseLetter("welcome") will output wmoclee

reverseLetter("brainly") will output blniary

You might be interested in
A technician is troubleshooting a Windows system in which an application works properly when the computer is booted in Safe Mode
sweet-ann [11.9K]

Answer:

yoooo nba BAD BAD

Explanation:

3 0
3 years ago
Kieran wants to search a database quickly for information on the last time a patient came to his medical facility. This informat
SpyIntel [72]
B I think is what it is
7 0
3 years ago
Read 2 more answers
Take any software or Application that you have recently purchased, this can be a video game or any other application helping you
IgorC [24]

A good product should have copyright protection which prevents others from using the product without permission.

Some products specify the penalties which are given to a person who makes unauthorized copies of their product and this is done to clearly educate to avoid ignorance claims.

A good product should have clear lettering which are legible and can be easily read, and should also have reasonable copyright protection.

<h3>What is Copyright?</h3>

This refers to the licensing which is done for a product and is also legally backed which prevents a person from illegally using or redistributing the work of a creator without their explicit consent.

Read more about copyright infringement here:
brainly.com/question/1078532

8 0
2 years ago
In programming, what is a string?
Alla [95]

A way to store a sequence of letters, numbers or symbols.

This is the most accurate statement, though not entirely true.

Hope this helps.

7 0
3 years ago
Read 2 more answers
Write the definition of a function minMax that has five parameters. The first three parameters are integers. The last two are se
guapka [62]

void minMax(int a, int b, int c, int*big, int*small)

{

if(a>b && a >c){

*big = a;

if(b>c)

*small = c;

else

*small = b;

}

else if (b>a && b>c){

*big = b;

if(a>c)

*small = c;

else

*small = a;

}

else{

*big = c;

if(a>b)

*small = b;

else

*small = a;

}

}

8 0
2 years ago
Other questions:
  • How can we set the color of a text that acts as a link in a web page​
    10·2 answers
  • Typically, a programmer develops a programâs logic, writes the code, and ____ the program, receiving a list of syntax errors.
    6·1 answer
  • 1. JAVA Create one method to do the following expressions. Given the following declarations, what is the result of each of the e
    13·1 answer
  • You use a cisco 2900 router in your network. you are considering purchasing and implementing the Unifield communications feature
    8·1 answer
  • A new employee has reported that print jobs are printing as garbled text. Which of the following is MOST likely the reason for t
    8·1 answer
  • How are online sources used? Check all that apply.
    8·2 answers
  • Java !!!
    10·1 answer
  • Javed’s teacher tells him she would like to see him improve his speaking skills in the next debate by including a rhetorical app
    9·1 answer
  • __________ is a computer tool for evaluating the risk of exposure to wildfires.
    8·2 answers
  • // This pseudocode is intended to describe
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!