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
For which of the four game elements will you give a detailed description about the challenges that the player will face, such as
vaieri [72.5K]

The four game elements that will give you  a detailed description about the challenges that the player will face is option D: objective.

<h3>What goals does game development have?</h3>

To bring about creativity and originality in task completion and issue solving. to prepare pupils for group collaboration.

Note that giving the player a clear objective gives them something to aim for. Make sure the player can relate to this motivation.

Therefore, The most crucial component of a game can be its objectives, which determine how the game is won or lost, what the player is instructed to perform in-game, and what the player must do to gain optional <em>Achievements</em>.

Learn more about objective from

brainly.com/question/18516671
#SPJ1

3 0
1 year ago
What does the program print out as a result of the given snippet of code?
dexar [7]

Answer:

5

Explanation:

well the function len gives the length of the list

so the length of supplies is

5

7 0
3 years ago
Read 2 more answers
list out the application of the computer and explain it?(and as the answer for this question as image) ​
amid [387]

Answer:

There are several applications of the computer; some of these applications are:

  • Word processors
  • Graphics applications
  • Web browsers
  • Gaming
  • Media players
  • Alarms and tasks schedulers
  • Etc...

Explanation:

The computer system can be applied in various fields (such as medicine, gaming, governments, education, etc.) for various purposes.

Each of these fields require computer software products and/or applications to carry out their activities. I've listed some applications, but there are several other applications.

<em>My explanation could not be submitted; so, I added it as an attachment.</em>

Download txt
3 0
3 years ago
Consider the following code segment, where num is an integer variable.int[][] arr = {{11, 13, 14 ,15},{12, 18, 17, 26},{13, 21,
Setler79 [48]

Answer:

c. 16 17

Explanation:

Given

num = 14

The above code segment

Required

The output

In the code segment, we have the following iterations:

for (int j = 0; j < arr.length; j++) and for (int k = 0; k < arr[0].length; k++)

The above iterates through all the elements of the array.

The if condition is true, only on two occasions

(i) When i = 0; j = 2

(ii) When i = 3; j = 0

i.e.

arr[0][2] = 14

arr[3[0] = 14

So, the result of the print statement is: j + k + arr[j][k]

(i) When i = 0; j = 2

j + k + arr[j][k]  = 0 + 2 + 14 = 16

(ii) When i = 3; j = 0

j + k + arr[j][k]  = 3 + 0 + 14 = 17

<em>Hence, (c) 16 17 is true</em>

6 0
3 years ago
Match each of the following terms to its definition:
Bingel [31]

I=B

II=C

III=E

IV=D

V=A

I have to write a bunch of extra things otherwise it won't let me post the answer lol.

7 0
3 years ago
Other questions:
  • In Word, tables can be styled much like text can.<br> True<br> False
    6·1 answer
  • Résumés for teenagers and young adults typically consist of<br> (Apex)
    11·2 answers
  • Some people are unable to arrange six matches to form four equilateral triangles because they fail to consider a three - dimensi
    6·1 answer
  • Două numere a și b sunt numite generatoare ale unui număr natural n dacă a∙b+[a/b]=n, unde s-a notat cu [c] partea întreagă a nu
    7·1 answer
  • In a CSS document, within what must you enclose properties and values when you define a rule for a specified selector?
    13·1 answer
  • 1.  
    15·1 answer
  • Would a hurricane form if the humidity is really high and the breeze is very low
    11·1 answer
  • 20. When you see ##### in a cell, you should
    8·1 answer
  • What is a header row?
    8·1 answer
  • Select the correct answer.
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!