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]
3 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]3 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
PLSS HELP ASAP ILL GIVE BRAINLIEST THANKS
Margarita [4]

Answer:

span > : A generic container that can be used for styling specific portions of text.

6 0
3 years ago
I'm taking computer science and we are using a software called Python, i never used it before and the assignment is hard for me
Anarel [89]
Python has a help page on google I would definitely recommend that. Here is a link to the beginners guide https://wiki.python.org/moin/BeginnersGuide
3 0
3 years ago
Under what driving conditions will 2019 Nissan LEAF’s available Rear Cross Traffic Alert (RCTA) warn the driver if a vehicle is
Dmitriy789 [7]

Answer:

When the driver is <em>reversing the car</em>

Explanation:

The Rear Cross Traffic Alert (RCTA) is Nissan's <em>risk  of collision detector</em> that warns drivers if one or more cars are approaching the rear of your car when backing up from a parking space.  

Sensors around the back of the vehicle identify vehicles drawing nearer from the either way. A notice tone and glimmering light will appear and  alert the driver to stop.  

5 0
3 years ago
Which statement best describes a computer program?
ziro4ka [17]

Answer:

B is the best answer.

Explanation:

All other options listed are related to a program but B beast answers the question.

7 0
2 years ago
Write a java program as follows Write a method called powOfTwo that takes an integer as parameter, computes, and outputs it’s sq
Kisachek [45]

Answer:

public static int powOfTwo(int input) {

 return input*input;

}

You will have to call this method in main
for printing it, write

System.out.println(powOfTwo(your number));

in public static void main(str[]args) {

}

8 0
2 years ago
Other questions:
  • Don is the superintendent of the county school system. What task might Don
    8·1 answer
  • Complete the function to replace any period by an exclamation point. Ex: "Hello. I'm Miley. Nice to meet you." becomes:
    9·1 answer
  • Which word in brackets is most opposite to the word in capitals? PROSCRIBE (allow, stifle, promote, verify)​
    14·2 answers
  • Do you think cyber-bulling is more damaging, as damaging, or less damaging than in-person bullying? Why?
    11·2 answers
  • The date June 10, 1960, is special because when it is written in the following format, the month times the day equals the year:
    6·1 answer
  • A user has called the company help desk to inform them that their Wi-Fi enabled mobile device has been stolen. A support ticket
    13·1 answer
  • 15. Cinematic tutorials and action-movie camera shots mixed with gameplay and some of the features that have made _____ stand th
    11·1 answer
  • Long Answer Questions: a. Briefly explain the types of Control Structures in QBASIC.​
    5·1 answer
  • The steps.txt file contains the number of steps a person has taken each day for a year. There are 365 lines in the file, and eac
    12·1 answer
  • Lists Five Examples of simple statement<br>​
    5·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!