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
An organization requires secure configuration baselines for all platforms and technologies that are used. If any system cannot c
Romashka [77]

Answer:

C. Process a risk acceptance for 2633 and remediate 3124.

Explanation:

There are various business risks. Some are inherited risks while other are risks are associated with nature of business. It is dependent on business owners that they want to accept risk or mitigate the risk. Risk acceptance is based on the strategy of the management. In the given scenario Accounting Prod Production has low risk 2633 which is accepted while 3124 is high risk which is remediated.

8 0
2 years ago
Pictures that you can click on to tell your computer what to do.
Tom [10]
What do you mean ? I’m confused..
6 0
3 years ago
Read 2 more answers
Which of the following is the shortcut key combination for pasting copied text?
lys-0071 [83]
Ctrl + v pastes copied text, ctrl + p brings up a print menu, ctrl + x cuts and copies highlighted text, while ctrl + c copies the highlighted text.
3 0
3 years ago
Read 2 more answers
Jim is in the market for a car that will last for the next 10 years and has saved up some money for the purpose of a car. What’s
Ratling [72]
I would imagine car would still be the best means , it's tough to define without knowing where he lives and how much he travels
8 0
3 years ago
You can use the Trim Video feature to specify a video file’s Start and End time in order to control which portion of the video f
mario62 [17]

Answer:

True

Explanation:

You can trim a video and actually set the start time and end time of a video on Powerpoint (a presentation software by microsoft) by following some simple steps.

select the video and click the playback tab, click the Trim video and a box will pop up, you can play the video and see how it is trimmed, and finally click OK.

5 0
3 years ago
Other questions:
  • Marie uses a browser to visit a blog. What is the unique identifier of the blog?
    13·2 answers
  • What’s the best description of an opportunity cost
    5·1 answer
  • 4.17 LAB: Varied amount of input data ( C++)
    5·1 answer
  • Please help! 40 points + Brainliest!
    8·1 answer
  • PLEASE HELP! One of the nice byproducts of joining a club, organization, community service project, or service learning project
    6·1 answer
  • Why might an algorithm created to assist in hiring decisions be biased?
    15·1 answer
  • What kind of skill is persuasion?
    7·1 answer
  • 20 POINTS! Which music making software is better? Ableton Live or Logic Pro? Name the advantages and disadvantages of each one!
    7·2 answers
  • Which of these is a neologism created as a result of the information age?
    6·1 answer
  • Write a recursive, string-valued method, reverse, that accepts a string and returns a new string consisting of the original stri
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!