Question DSA-STR-0043
MediumWhat is the output of this code?
def is_pal(s):
t = [c.lower() for c in s if c.isalnum()]
return t == t[::-1]
print(is_pal("A man, a plan, a canal: Panama"), is_pal("race a car"))
- A.
False False
- B.
True False
- C.
Sign up free to see the answer and a step-by-step explanation.