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
postnew [5]
3 years ago
9

Write a program that prompts the user for a word or phrase, and determines if the entry is a palindrome. A palindrome is a word

or phrase which reads the same forwards and backwards. For example, if the user entered: madam the program should display: That is a palindrome Your program should ignore spaces, commas, and apostrophes, and ignore differences between upper and lower case. For example, the phrase: Madam, I'm Adam would be considered a palindrome.
Computers and Technology
1 answer:
vekshin13 years ago
7 0

Answer:

Explanation:

The following code is written in Python. It asks the user for an input. Then cleans the input using regex to remove all commas, whitespace, and apostrophes as well as making it all lowercase. Then it reverses the phrase and saves it to a variable called reverse. Finally, it compares the two versions of the phrase, if they are equal it prints out that it is a palindrome, otherwise it prints that it is not a palindrome. The test case output can be seen in the attached picture below.

import re

phrase = input("Enter word or phrase: ")

phrase = re.sub("[,'\s]", '', phrase).lower()

reverse = phrase[::-1]

if phrase == reverse:

   print("This word/phrase is a palindrome")

else:

   print("This word/phrase is NOT a palindrome")

You might be interested in
True or false there is no relationship between the purpose of the page and the page quality
erastovalidia [21]

True, this is correct. There is no relation between page purpose and page quality, because the way they rate the quality of the page depends on the appearance and content of the page.

8 0
3 years ago
Question 4 of 25
Semmy [17]

A situation which modular design would be least beneficial for a game program is: A. the program is extremely simple.

<h3>What is modular design?</h3>

Modular design can be defined as a software development technique that involves the separation of the overall functionality of a software into independent and interchangeable software sections or modules.

Also, modular design can be used to break a large code in a software into smaller blocks holding specific functions.

In this context, we can infer that modular design would be least beneficial for a game program when the software program is extremely simple.

Read more on modular design here: brainly.com/question/14192464

#SPJ1

6 0
2 years ago
1.) what is the minimum number of bits required to represent -3,997 using 2's complement form?
lisabon 2012 [21]

The binary representation of +3997 is 1111 1001 1101.

In one's complement this is simply adding a sign bit and inverting all the bits:

1 0000 0110 0010

The two's complement is the one's complement plus 1:

1 0000 0110 0011

That's 13 bits. Normally the sign bit would be at an 8, 16 or 32,... bit boundary.

For -436 it's 10 0100 1100 and 10 bits


8 0
3 years ago
Does the estimate of a tolerance level of 68.26% of all patient waiting times provide evidence that at least two-thirds of all p
ivanzaharov [21]

Answer:

Yes, because the upper limit is less Than 8 minutes

Explanation:

According to the empirical formula :

68.26% of data lies within 1 standard deviation from the mean;

Hence,

Mean ± 1(standard deviation)

The sample mean and sample standard deviation of the given data is :

Sample mean, xbar = Σx / n = 546 / 100 = 5.46

Sample standard deviation, s = 2.475 (Calculator)

The interval which lies within 68.26% (1 standard deviation is) ;

Lower = (5.460 - 2.475) = 2.985

Upper = (5.460 + 2.475) = 7.935

(2.985 ; 7.935)

Since the interval falls within ; (2.985 ; 7.935) whose upper level is less than 8 means patients will have to wait less Than 8 minutes.

8 0
3 years ago
A technician is dispatch to troubleshoot a user's computer.
Margarita [4]

Answer:

All of the above.

Explanation:

Thrashing or drive or disk thrashing occurs when the hard drive is stressed with transferring information between the system memory and virtual machine excessively. In thrashing, there is a large number of processes running in the system and the system memory is too small to handle all processes. Thrashing leads to decreased system performance and hard disk failure.

To stop the impact of thrashing, install more RAM, end unimportant progam processes etc.

5 0
3 years ago
Other questions:
  • Which career path includes the work duties of hiring and managing farm laborers?
    6·2 answers
  • Please someone helpp
    12·2 answers
  • In the Microsoft Excel spreadsheet how many choices are possible when using a single IF statement​
    9·1 answer
  • Which of the following is NOT an example of soft skill?
    8·1 answer
  • The image below shows an encoding for a black and white pixel image. The first two
    13·1 answer
  • Who Has any idea How to code?
    7·2 answers
  • Jill is configuring the AutoArchive feature in Outlook 2016. What is the default setting in relation to when AutoArchive
    8·1 answer
  • Type the correct answer in the box
    13·1 answer
  • A(n) _____ is a computerized system by which subscribers are able to communicate to all other subscribers by sending a transmiss
    5·1 answer
  • Identify and explain groups that may be impacted by nanotechnology.
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!