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
Tools enable people to connect and exchange ideas
Sedaia [141]
True, throughout history this is prominent.
5 0
3 years ago
Read 2 more answers
True or false FAFSA awards work study, but jobspeaker can be used to learn which jobs are available
Kruka [31]

Answer:

true

Explanation:

random because it's FAFSA and that ain't a word

3 0
2 years ago
A ______ connection provides fast internet service and the ability to exchange large files. ​
Degger [83]

Answer:

broadband

Explanation:

A<u> broadband</u> connection  provides fast internet service and the ability to exchange large files. ​

3 0
3 years ago
Advantages and disadvantages of java
solong [7]

Answer:

1. Java is Simple · 2. Java is an Object-Oriented Programming language · 3. Java is a secure language · 4. Java is cheap and

Explanation:

5 0
3 years ago
Algebraic concepts that include certain words and phrases and
Veseljchak [2.6K]

Answer:

Boolean Operators

Explanation:

When performing a boolean search, boolean operators allow users to combine keywords with operators (or modifiers) such as AND, NOT and OR to further produce more relevant results.

The boolean operators AND and OR are used to include certain words and phrases during the search while the  boolean operator NOT is used to exclude certain words and phrases.

6 0
3 years ago
Other questions:
  • Isaac is researching Abraham Lincoln’s life for a social studies report. He finds an encyclopedia that includes original letters
    5·2 answers
  • The desktops of computers running the same OS all look the same
    8·1 answer
  • Suppose your name was Alan Turing. Write a statement that would print your last name, followed by a comma, followed by a space a
    10·1 answer
  • When was internet started in which year​
    13·2 answers
  • Anthony is responsible for tuning his organization's intrusion detection system. He notices that the system reports an intrusion
    8·1 answer
  • Which result is most likely if a network packet has no header?
    9·2 answers
  • Using ________ as a promotion method will bring return visitors to your site.
    8·1 answer
  • 2. Select the things you can do when working with rows in columns in a spreadsheet:
    5·1 answer
  • Can somebody help me with this please
    6·2 answers
  • 1. Which of the following is not true about high-level programming language s? (a) Easy to read and write (b) Popular among prog
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!