Create a program, palindrome.py, that has a function that takes one string argument and prints a sentence indicating if the text is a palindrome. The function should consider only the alphanumeric characters in the string, and not depend on capitalization, punctuation, or whitespace. If your string is a palindrome it should print: It's a palindrome! If it is not a palindrome, it should print: It's not a palindrome!

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question

Hey there, please help why my code doesn't pass on code grade. The instructions are to use the sys arg for each assignments. But I did't get on how to properly apply the sys arg  or the sys argv to each of my code functions so that it correctly prints each inputs, one at a time on Code Grade than putting them all in one as output for each inputs.  

For example I want to show me "where" to correctly apply(with steps) with code that works(prints correctly) after applying, for the following: 

Create a program, palindrome.py, that has a function that takes one string argument and prints a sentence indicating if the text is a palindrome. The function should consider only the alphanumeric characters in the string, and not depend on capitalization, punctuation, or whitespace.

If your string is a palindrome it should print: It's a palindrome!
If it is not a palindrome, it should print: It's not a palindrome!

 *Note: please copy and paste these versions into your code because the type of apostrophe can differ between Atom, Jupyter, command line, etc.

 

inputs / 4 inputs:

1/ anna

///must print out: It's a palindrome!

2/ Hello world

///must print out: It's not a palindrome!

3/ Ed, I saw Harpo Marx ram Oprah W, aside

    ///must print out: It's a palindrome!

4/ 'Dennis, Nell, Edna, Leon, Nedra, Anita, Rolf, Nora, Alice, Carol, Leo, Jane, Reed, Dena, Dale, Basil, Rae, Penny, Lana, Dave, Denny, Lena, Ida, Bernadette, Ben, Ray, Lila, Nina, Jo, Ira, Mara, Sara, Mario, Jan, Ina, Lily, Arne, Bette, Dan, Reba, Diane, Lynn, Ed, Eva, Dana, Lynne, Pearl, Isabel, Ada, Ned, Dee, Rena, Joel, Lora, Cecil, Aaron, Flora, Tina, Arden, Noel, and Ellen sinned.'

///must print out: It's a palindrome!

 

Remember again: I have the correct code for the abve question; but my main question is on how, where to apply, to show me with working code: the sys arg / sys argv, so that it correctly run/pass on "Code Grade" submission port. (Answer + sys arg ). Remember using just sys arg at the beginning doesn't worked for me. There should be, more application with the input or the arguments with in the code itself. 

 

Thank you in advance.

 

Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 3 steps with 2 images

Blurred answer
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education