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
The ____ auto fill option that fills the destination area using the format of the source area; no content is filled.
attashe74 [19]
The AUTO FORMATTING ONLY is an auto fill option that fills the destination area using the format of the source area; no content is filled. This is opposite from auto without formatting on which it fills the destination area without formatting.
5 0
3 years ago
Cuando, Quien, Donde y Como empieza a funcionar Amazon?
vlabodo [156]

Answer:

It started working in July 16,1995. Mr Jeff Benzos was the founder of Amazon. An is located in 410 Terry Ave N, Seattle 98109,WA.

Explanation:

7 0
3 years ago
The two objects representing values FALSE & TRUE are called _________Integers​
scoundrel [369]

Answer:

true because I just had a test like this today and it put true and got it correct

5 0
3 years ago
When’s The release date for Mobile legends project next phase 3 going To come
Gennadij [26K]

Answer: This Project will involve Hero Revamps, Hero Adjustments, Hero Remodels, and much more. Project NEXT is divided into 2 phases: the first phase was released on September 22, 2020, the second phase was released on June 15, 2021 and the third phase is to be released on "September 2021".

4 0
3 years ago
In excel what is the biggest disadvantage of copying a worksheet into another workbook?
Mariana [72]
The answer might be wrong and you could get caught
7 0
3 years ago
Other questions:
  • A food web is shown below. In this food web, energy is transferred directly from the to the
    11·1 answer
  • Which of the following STEM discoverers developed a new type of computer hardware?
    11·1 answer
  • Which query will give the following result when it it applied on table 1????!!!!!
    10·1 answer
  • Which career path includes the work duties of hiring and managing farm laborers?
    6·2 answers
  • Someone help meeeeeeeee plz.......................
    11·2 answers
  • When you sign in to your Microsoft account with another Windows device, your settings will appear very differently than they do
    7·1 answer
  • )
    11·1 answer
  • I have a top-secret recipe for the greatest cookie dough I have made and I want to keep the recipe a secret so I apply for a? *
    15·1 answer
  • Another word for asking a question of your data is to _____ it.
    6·1 answer
  • Computers rarely make mistakes. True or false
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!