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
Show the printout of the following code.
alexira [117]

Answer:

E. 7.0

Explanation:

the 7 of the out of the older and make a shame of waves and force of trying

7 0
3 years ago
IBM’s system that is built on the middle ground approach to AI.
Norma-Jean [14]

Answer:

IBM Watson is AI for business. Watson helps organizations predict future outcomes, automate complex processes, and optimize employees' time.

Explanation:

6 0
3 years ago
What is the channel capacity for a teleprinter channel with a 300 Hz bandwidth and a signal-to-noise ratio of 30dB, where the no
wolverine [178]

Answer:

The answer is 2988 bits per seconds

Explanation:

Solution

Given that:

Bandwidth (B) = 300Hz

Signal to noise ratio (SNR) = 30dB

Now let C = channel capacity

Using  Deubel formula we have the following:

SNR db = 10* log (SNR)

30 =10* log (SNR)

So,

SNR =log^⁻1 (3)

SNR = (10)^3

SNR = 1000

Thus SNR =1000

Now

Applying the Shannon's equation

C = B * log₂ ( 1 + SNR)

C = 300 * log₂ ( 1 + 1000)

C = 300 * log₂ (1001)

C = 300 * 9.96

C =2988

Hence the capacity of the channel for teleprinter channel is 2988 bits per second.

8 0
4 years ago
In what way do media and networks interact? A.) Media are connected to networks tat make information easier to share. B.) Networ
kolbaska11 [484]

Your answer is A.... Hope this helps :)

6 0
4 years ago
A database has a built-in capability to create, process and administer itself.
kherson [118]

Answer:

false

Explanation:

6 0
3 years ago
Other questions:
  • 4. The programmer who focuses on implementing the game mechanics, rules, and other elements essential for gameplay is the
    13·1 answer
  • What is a fragment shader? Question 5 (3 marks) What is trilinear filtering?
    8·1 answer
  • How do I only give 5 points and not 10?
    7·1 answer
  • An employee who interacts with customers regarding the nature of their car problems, rather than actually working on the vehicle
    6·1 answer
  • 6. What type of application is designed for making slide shows?​
    12·2 answers
  • Question 11
    9·1 answer
  • Write function that ask for input from a user. Use this input as input for the countdown function that we wrote using the while
    6·1 answer
  • If Jake wants to find out if the size of a fruit has any effect on the total sales for the week of that particular fruit, what c
    15·1 answer
  • Which items in the list below are viruses. Click in the box to select your answer(s).
    8·1 answer
  • _________ is an alternative name for the main memory.help me​
    14·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!