-1
\$\begingroup\$

write a function to tell if a number is symmetric or not. for example:

input: 151 output: True

input: 142 output: False

and so on: 1111 True, 2390 False, 1226221 True

\$\endgroup\$
4
  • \$\begingroup\$ My question is not a duplicate, your's involve matrix and mine is different \$\endgroup\$
    – AndiChin
    Commented Aug 7, 2018 at 14:35
  • 2
    \$\begingroup\$ Your question is largely the same; the older question asks "is it a palindrome in base X" whereas yours asks "is it a palindrome in base 10", so answers to the duplicate question would automatically be competitive here, with very little modification. \$\endgroup\$
    – Giuseppe
    Commented Aug 7, 2018 at 14:38
  • 1
    \$\begingroup\$ The challenge this was marked as a duplicate of only requires to convert the input to another base. This is just a special case with base \$10\$. By convention, when trivial modifications can be made to port the majority of answers from one challenge to the other while they are still competitive, marking one challenge as a duplicate of the other is recommended. \$\endgroup\$
    – Mr. Xcoder
    Commented Aug 7, 2018 at 14:39
  • 5
    \$\begingroup\$ Either way, welcome to Programming Puzzles & Code Golf! Don't let the fact that your first challenge was marked as a dupe discourage you from posting in the future! In fact, to avoid such situations we have a Sandbox, where you can show your challenge to others prior to posting on the main site to receive feedback. \$\endgroup\$
    – Mr. Xcoder
    Commented Aug 7, 2018 at 14:43

1 Answer 1

0
\$\begingroup\$

Python 2, 23 bytes

lambda n:`n`==`n`[::-1]

Try it online!

\$\endgroup\$

Not the answer you're looking for? Browse other questions tagged or ask your own question.