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]
4 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]4 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 __________ is a combination of software and hardware that links two different types of networks.
timurjin [86]
A computer system is a combination of software and hardware that links two different types of networks
5 0
3 years ago
_______ are fasteners that connect parts and are intended to resist pulling forces. A. Extension springs B. Compression springs
madam [21]
The answer is Lock washers
6 0
4 years ago
How does the movement of earth in space create cycles we all experience?
Contact [7]
Actually, humans can not feel the Earth's movement because of our atmosphere(:
5 0
4 years ago
Which of the following best describes a hacktivist? Select one: a. An individual who attempts to destroy the infrastructure comp
brilliants [131]

Answer: (B) An individual who hacks computers or Web sites in an attempt to promote a political ideology

Explanation:

 Hacktivist is the defined as an individual that basically hacks the various types of web sites and computer system for promoting the various political ideologies. The hacktivists is the method which include the DDOS attacks (Distributed denial of services).

It basically causes various website and the email with the congestion of traffic with the computer virus and by the data stealing. The denial of services attacks typically considered federal crime and illegal in united state.  

4 0
4 years ago
What is output if month = 11 and day = 14?
goldfiish [28.3K]

Cheese

…………………………..tggggggcfcgvgvv

4 0
3 years ago
Read 2 more answers
Other questions:
  • An intranet is a way for a company or organization to protect copyrighted and other important information?
    15·2 answers
  • The advanced boot options screen can be displayed by pressing what key during the boot sequence?
    6·1 answer
  • Your computer is taking longer than usual to open files and you notice that your hard drive light stays on longer than usual. Wh
    10·1 answer
  • The ability to anticipate and determine upcoming driving hazards and conditions are adversely affected by stress.
    10·1 answer
  • A dmz is a subnet of _____________ accessible servers placed outside the internal network.
    10·1 answer
  • Rapid development programming languages eliminate the possibility of having bugs in code. True or False
    8·1 answer
  • Using a windows computer, to make a window wider, you would move the pointer until it changes to the horizontal resize shape and
    6·1 answer
  • What is the answer to this question?
    10·1 answer
  • What is one of the main problems that can occur when Implementing a large number of new systems within an organization
    11·1 answer
  • Given a MxN matrix.Print the elements in odd rows from left to right and the elements in even rows from right to left.(Java or C
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!