Python Forum
Program to check whether a number is palindrome or not
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Program to check whether a number is palindrome or not
#9
(Sep-07-2023, 01:42 PM)PythonBoy Wrote:
(Sep-07-2023, 01:33 PM)DPaul Wrote: Hi, No loops allowed ? then try:
x = '1234321'
y = x[::-1]
Is y == x ?
Paul

Although this is not the way my teacher wants me to do it,

I am interested in this method also. Could you please explain why did we write y = x[::-1]?
Reply


Messages In This Thread
RE: Program to check whether a number is palindrome or not - by PythonBoy - Sep-07-2023, 01:43 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Python Program to Find the Factorial of a Number elisahill 2 3,206 Nov-21-2022, 02:25 PM
Last Post: DeaD_EyE
  Program that allows to accept only 10 integers but loops if an odd number was entered gachicardo 4 6,941 Feb-24-2022, 10:40 AM
Last Post: perfringo
  Palindrome checker case sensive edwdas 3 3,537 Nov-07-2019, 05:57 PM
Last Post: nilamo
  Program that displays the number with the greatest amount of factors ilusmd 3 3,703 Nov-01-2018, 08:28 PM
Last Post: ichabod801
  Palindrome program - I can't figure it out. Gabar112 3 4,396 Feb-20-2018, 07:03 PM
Last Post: Larz60+
  Palindrome.strip pirts.emordnilaP RodNintendeaux 4 4,838 Oct-08-2017, 02:30 AM
Last Post: RodNintendeaux
  Program to print: Last Name, ID, Mobile Number, All panick1992 14 12,203 Mar-15-2017, 02:46 PM
Last Post: panick1992

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020