Skip to content

Instantly share code, notes, and snippets.

@Akash671
Last active August 8, 2021 21:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Akash671/52696bfa945ae657911a43418be99319 to your computer and use it in GitHub Desktop.
Save Akash671/52696bfa945ae657911a43418be99319 to your computer and use it in GitHub Desktop.
def saveIronman (s) :
#Complete the function
#s = input("Enter a string: ")
only_alpha= ""
for char in s:
if char.isalpha() or char.isdigit():
only_alpha += char
S=only_alpha.lower()
if(S==S[::-1]):
# print("YES")
return True
else:
# print("NO")
return False
#{
# Driver Code Starts
#Initial Template for Python 3
for _ in range(0,int(input())):
s = input()
ans = saveIronman(s)
if(ans == True):
print("YES")
else:
print("NO")
# } Driver Code Ends
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment