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
Lostsunrise [7]
2 years ago
5

I need to reverse a inputted word using for loops with range 0 to the input word and increment 1.

Computers and Technology
1 answer:
Ksivusya [100]2 years ago
4 0

fruit_name = input("What is your favorite fruit: ")

fruit_len = len(fruit_name)

fruit_len = int(fruit_len)

reversed_word = ""

lower = 0

upper = fruit_len

inc = 1

for lp in range(lower, upper, inc):

   reversed_word = (fruit_name[lp] + reversed_word)

   reversed_word = str(reversed_word)

print(fruit_name + " backwards is " + reversed_word)

I just changed the str(lp) to fruit_name[lp]. This takes lp as the index of fruit_name and gets the letter at that index. We then add that letter to the existing reversed_word. I think this is what you're looking for.

You might be interested in
What is the name of the item that supplies the exact or near exact voltage at the required wattage to all of the circuitry insid
gizmo_the_mogwai [7]

Answer:

It's the <u><em>power supply</em></u>

Explanation:

The power supply is what essentially enables the computer to operate. It is able to do that by converting the incoming alternating current (AC) to direct current (DC) at the correct wattage rating that is required by the computer to function. The power supply is a metal box that is generally placed in the corner of the case.

4 0
3 years ago
Why is monitor called softcopy output device?​
Mademuasel [1]

Answer:

A display device is the most common form of output device it presents output visually on a computer screen.the output appears temporarily on the screen and can easily altered or erased,it is sometimes referred to as softcopy

7 0
3 years ago
To change lowercase letters to uppercase letters in a smaller font size, which of the following should be done?
sergeinik [125]

Explanation:

Format the text in Small caps. Manually replace the lowercase letters with uppercase letters.

7 0
3 years ago
The count function is used to total the values stored in numeric columns.
Dovator [93]

Answer : False.

The function to total the values stored in numeric columns is the SUM function.

5 0
3 years ago
'|'/2`/ '|'[] |)[-([]|)[- '|'#!$
natita [175]

Answer: mr Man

Explanation:

7 0
3 years ago
Other questions:
  • Can someone please help me with this question?
    12·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
  • Badin Industries runs a web application that processes e-commerce orders and handles credit card transactions. As such, it is su
    9·2 answers
  • Que son los sistemas de control con retroalimentacion
    10·1 answer
  • Which of the following helps create a positive community?
    11·1 answer
  • ______________ is a raw fact about a person or an object
    6·1 answer
  • Write a program that reads a list of integers, and outputs whether the list contains all even numbers, odd numbers, or neither.
    5·1 answer
  • Write a program that accepts two integers from the user and perform one of the four arithmetic operations based on user’s choice
    11·1 answer
  • Helppppppppppp please
    5·2 answers
  • Which type of relationship is responsible for teaching you values and how to communicate?
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!