-1
string = (input("Enter your own string: "))
if string == string[::-1]:
  print("This is a Palindrome")
else:
  print("This is not a Palindrome")

I want this code to not care about lower or upper case please

Yokoe
  • 1
  • 2
  • Then just make it lower case every time -> `if string.lower() == string[::-1].lower()` – Smitty Oct 15 '20 at 21:45
  • Learn about built in string functions here in the documentation https://docs.python.org/3.8/library/stdtypes.html?highlight=lower#str.lower – barny Oct 15 '20 at 21:46
  • 3
    FYI If you searched just a little bit for relevant keywords like in this case _python string lower case_ you would find loads of helpful results without having to ask a question here. And then you wouldn’t risk downvotes and close votes for questions which you could answer yourself with minimal research :-) – barny Oct 15 '20 at 21:48

1 Answers1

0

First either convert the string to all lower or upper characters like this;

new_str = string.lower()
if new_str == new_str[::-1]:
   ...rest of your code here
Fnechz
  • 91
  • 6