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]
2 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:
vekshin12 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
Rohan is creating a presentation with at least 50 slides. He wants the slides to use a consistent layout and formatting. Which o
erma4kov [3.2K]

The parts of the presentation that he should design first is Slide master

Slide master is a slide that enables you  to do the following:

•Modify your presentation to suit your taste

•It enables you to make  a partial or minor change  on the slide layout of your presentation

•Slide master  help you to  create a perfect and special  presentation.

•With Slide master  you can easily modify your slide text color.

Inconclusion The parts of the presentation that he should design first is Slide master.

Learn more about Slide master here:

brainly.com/question/12600334

4 0
2 years ago
The use of IDPS sensors and analysis systems can be quite complex. One very common approach is to use an open source software pr
lawyer [7]

Answer:

IDP sensors can be complicated.An open-source software program called snort program.

Explanation:

Snort is an open-source network intrusion detection system (IDS) and prevention system. It is created in 1998 by Martin. Snort's open source network-based can perform analysis and packet logging on an Internet Protocol network.

The snort program can be used to detect probes or attacks. Snort configured three modes

sniffer

pocket logger

network intrusion detection.

6 0
3 years ago
Read 2 more answers
Michael works for a graphic design firm. He is creating an informative poster. He needs to add a great deal of text in the poste
Dennis_Churaev [7]

Michael will use a Adobe Photoshop or CorelDraw   tool to help format the text for creating an informative poster.

<h3>What application is used for graphic design?</h3>

They are:

  • Adobe Photoshop
  • Illustrator, GIMP
  • CorelDraw
  • Canva  and others

Based on the American Institute of Graphic Arts (AIGA), graphic design is known to be a term that is described as “the art and method of planning and bringing forth ideas and experiences along with the use of visual and textual content.”

Therefore, Michael will use a Adobe Photoshop or CorelDraw   tool to help format the text for creating an informative poster.

Learn more about graphic design from

brainly.com/question/27019704

#SPJ1

3 0
2 years ago
What is the top anime shows? &lt;3
LenKa [72]

Answer:

This is personally based on my opinion.

My top 10 favorites

Toradora

Darling in the franxx

Lucky Star

My Melody

Death note

Attack on titans

One piece

The Promise neverland

Kaguya-sama: love is war

Black cover

4 0
2 years ago
Read 2 more answers
If Carly wants to add wind belts for the part of the Atlantic just south of the equator, how should she draw the arrows?The arro
AnnyKZ [126]

If Carly wants to add wind belts for the part of the Atlantic just south of the equator, she should draw the arrows upward to the left. <span> At the South of the equator are trade winds which blow wind from the northeast toward the equator. </span>

4 0
2 years ago
Other questions:
  • How to track flash socket server connections wireshark?
    10·1 answer
  • The purchase and subsequent sale of a securities position in a customer account solely to generate commissions is____________.
    15·1 answer
  • Who is the primary audience for demonstrations of game prototypes made by the developer?
    8·1 answer
  • keeping in mind the role in order of precedence plays in equations, what would excel display as the result of the following equa
    14·1 answer
  • Which of the following is false about arrays? Group of answer choices
    15·1 answer
  • How does recorded audio stay on an audio tape
    12·1 answer
  • State Whether the given statement are TRUE OR FALSE. 13X1=13
    10·1 answer
  • A class is a type of object that defines the format of the object and the actions it can perform. True False
    14·1 answer
  • In addition to developing sketches, computer-aided design programs are used by fashion designers to perform which task?
    10·1 answer
  • A technique that was developed to determine whether a machine could or could not demonstrate the artificial intelligence known a
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!