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
MA_775_DIABLO [31]
3 years ago
11

Implement the function _isPalindrome() in palindrome.py, using recursion, such that it returns True if the argument s is a palin

drome (ie, reads the same forwards and backwards), and False otherwise. You may assume that s is all lower case and doesn’t include any whitespace characters.
Computers and Technology
1 answer:
GREYUIT [131]3 years ago
8 0

Answer:

The function is as follows:

def _isPalindrome(stri) :

  if len(stri) == 0:

     return True

  if stri[0] == stri[len(stri) - 1]:

     return _isPalindrome(stri[1:len(stri) - 1])

  else:

     return False

Explanation:

This defines the function

def _isPalindrome(stri) :

If the string is empty, then it is palindrome

<em>   if len(stri) == 0: </em>

<em>      return True</em>

This checks if the characters at alternate positions are the same.

If yes, it calls the function to check for other characters<em> </em>

<em>   if stri[0] == stri[len(stri) - 1]: </em>

<em>      return _isPalindrome(stri[1:len(stri) - 1]) </em>

If otherwise, the string is not palindrome

<em>   else: </em>

<em>      return False</em>

<em />

You might be interested in
Select each task that may be completed using a word processor.
Y_Kistochka [10]

Answer:These are your answers

B.) Type a paragraph.

C.) Take notes for social studies class.

D.) Edit a paragraph.

Explanation:

Typing an paragraph can be able to be used in an word processor because he can fix grammatical errors.

All the the answer choices I picked can be processed through an word processor Because they all are created using words.

8 0
3 years ago
Read 2 more answers
What game is a great example of a story unfolding as the levels increase where the player learns more about the plight of the pr
Phantasy [73]
Fortnite and mario kart are good examples
4 0
3 years ago
Read 2 more answers
In batch operating system three job J1 J2 and J3 are submitted for execution each job involes an I/O activity a CPU time and ano
salantis [7]

Answer:

(A) The CPU time for J1 is =2 ms other time is =18 ms, for J2 CPU time =6 ms other time = 24 ms, for J3 CPU time = 3 ms and other time = 12 ms (B) The CPU Utilization for uni-programming is 0.203 or 20.3% (C) For Multi-programming, when a program is not free and busy with an operation, the CPU is allocated to other programs.

Explanation:

Solution

Given that:

A(1)Job J1 = CPU time = 2ms  

Other time =18 ms

Total time = 20 ms

(2)Job J2 = CPU time 6ms

Other time = 24 ms

Total time = 30 ms

(3)Job J3 = CPU time = 3ms

Other time =12ms

Total time = 15 ms

(B) For the CPU Utilization for uni-programming, we have the following as follows:

CPU utilization =The total time of CPU/The total real time

Thus,

=(2 +6+3) / (18+24+12)

= 11/54

=0.203 or 20.3%

(C) For the CPU utilization for multi-programming,  when a program is not available that is busy in an operation, such as the input and output the CPU can be allocated or designated to other programs

5 0
3 years ago
Where are the values the computer is directly working with at a particular moment in time stored?
pav-90 [236]

On the CPU register (?) The CPU registers are registers with small amounts of high-speed memory contained within the CPU. They are used by the processor to store small amounts of data that are needed during processing

Hope this helps and that you have a good day

4 0
3 years ago
Which one of the following items is an example of software?
Harlamova29_29 [7]
Word processing program is an example of a software. All the others, such as Printer, Keyboard and Mouse are examples of Computer peripheral devices or in short hardware devices. Generally these listed hardware devices come under input or output computer device category. Also, by classic meaning in layman terms these hardware components can be touched or felt. In contrast, a word processing program is a part of a computer system that consists of data or computing instructions and provides the mechanism to computer to perform a certain task utilizing it's hardware resources. Such components of computer system which are written using one of the computer languages are called computer software or software programs or simply software.
4 0
3 years ago
Other questions:
  • Which of the following is a dynamic lot-sizing technique that calculates the order quantity by comparing the carrying cost and t
    10·1 answer
  • Is there anyone who is learning coding if so then can you tell me how to be perfect in coding​
    14·1 answer
  • What does psychologist Edward Spector mean when he says “ We have an entire generation of guinea pigs in an experiment”?
    14·1 answer
  • 1. The @ symbol is used to denote:​
    7·1 answer
  • On the server side, the database environment must be properly configured to respond to clients' requests in the fastest way poss
    12·1 answer
  • Cost Benefit Analyses (CBAs) cannot be calculated after controls have been functioning for a time, as observation over time prev
    13·1 answer
  • One shortcoming of rapid application development (RAD) is _____.
    9·1 answer
  • our grandmother tells you a dollar doesn’t go as far as it used to. She says the “purchasing power” of a dollar is much less tha
    6·1 answer
  • 6.7 — Trickier Trap 4
    7·2 answers
  • Which of these is true about moores law
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!