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!
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.
Trending now
This is a popular solution!
Step by step
Solved in 3 steps with 2 images