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
Paano nakatutulong ang teknolohiyang pangkomunikasyon sa pangangalap ng impormsyon
Makovka662 [10]

Answer:

Yes correct. Absolutely breathtaking. You should create poetry with your writing skills.

6 0
3 years ago
On the cities worksheet, click cell f4 and enter a formula that will subtract the departure date (b1) form the return date (b2)
Mademuasel [1]
=(+B2-B1)*F3 is what you need to enter in cell F4
8 0
3 years ago
Is www part of every url address?
melisa1 [442]
The correct answer is that WWW. is universal, meaning that any and all url addresses start and have www.

My reasoning is that if you were to look up, lets say google, do :

www.(google).com ( remove parentheses )

then

google.com 

You come up with the same results THUS YOUR CORRECT ANSWER IS YES! ALL URL ADDRESS HAVE AND CONTAIN WWW.!!!

5 0
4 years ago
Given the following code, what will it display?
trapecia [35]
Number#4 = 55 ; start counting from 0
4 0
4 years ago
Read 2 more answers
When adding a new record, which key can be pressed to move to the next field?
Anika [276]

Answer:

O Tab

Explanation:

In order to add a new record the key that should be used to move to the next field is tab key

while the other keys are used for the other purpose

But for adding a new field, new record, a tab key should be used

Therefore the last option is correct

8 0
3 years ago
Other questions:
  • How can you create balance to your drawing using only grayscale values?
    12·1 answer
  • What is one way to measure technological progress?
    5·1 answer
  • Emilio is reviewing the data he collected from historical records about immigration in the united states. He decides to create a
    5·1 answer
  • One example of a Microsoft Store app is Select one: a. Photos. b. Paint. c. File Explorer. d. Notepad.
    10·1 answer
  • Suppose you are given a sequence that is described by a formula, starting at index n=0. If you need to change the starting index
    6·1 answer
  • The blue section of the following Venn diagram could represent which of the following Boolean statements?
    14·1 answer
  • While using a web-based order form, an attacker enters an unusually large value in the Quantity field. The value he or she enter
    15·1 answer
  • Pls help
    13·1 answer
  • Help me pleaseeee!!!!!
    6·2 answers
  • 14. How do digital libraries address the problem of digital exclusion?
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!