Python Program To Check Whether A Number Is A Palindrome Or Not

preview_player
Показать описание
Рекомендации по теме
Комментарии
Автор

# First we have to take input from the user
num = input("Enter a number: ")

# Now we have tor reverse the string
num1 = num[::-1]

# Checking if the reversed string is equal to original (Checking if its Palindrome)

if (num==num1):
# If condition true print
print("The number is palindrome.")

else:
# If condition false print
print("The number is not palindrome")

ShaheerAziz-fe
Автор

mystr = input("Enter to check if its Palindrome")

if mystr[::-1].strip() == mystr.strip():
print("Yes It is a Plaindrome")

else:
print("No It is not a Plaindrome")

mulikeparathe
Автор

sir plz make a video about how we think about the logic.

badgamer
Автор

so beautiful harry, you solved my querry, thank you so much for awesome video

sachintandon
Автор

name = input()
reverse = name[::-1]

if name == reverse:
print("palindrome")
else:
print("not palindrome")

abrarulhasan
Автор

congratulations sir for 5.9 million and 6 million is counting ❤

sumitbisht
Автор

please add more these kind of stuffs. thankyou harry

rudramondal
Автор

472 subs while makin it and now 624k awesome journey brother!!

ShivamGupta-hrsn
Автор

a = input()
if a.lower()[::-1] == a.lower():
print('Palindrome')
else:
print('Not a Palindrome')

geeli_puppy_.
Автор

Extremely helpful, thank you very much!!

HarshitSatyawali-ubki
Автор

#PALLINDROME NUMBER
#STRING DATA TYPE

x=input("Enter your values : ")
reverse=x[ : : -1]
if x==reverse:
print("Pallindrome no.", "=", x)
else:
print("NOT", "=", x)

jhadadae
Автор

Thankyou soo much harry bhai,
Ek dum simple way mei explain karte ho aap

dvfoodworld
Автор

you had 735 subs that time, now its 6.1M. damn you cooked right

padhakukukki
Автор

num = int(input("Enter the number:\n" ))

listnum = list(map(int, str(num)))

revlist = listnum[::-1]

if listnum == revlist:
print("The number is palindrome.")

else:
print("The number is not palindrome")
#Bhai sabse asan tarika..using map and list slicing taught by you in other videos. So i tried this easiest way..How is it?

suryakantbamane
Автор

2.02 million dot ke bina palindrome hai. congrats

sm_in
Автор



A=input()
B=A[::-1]
print(B)
if A==B:

else:

shakilkhanafridi
Автор

wow 735 to 4 million subscribers maan gye guru ji

JayAditya-ihzy
Автор

Bhai ke 735 subscribers the 5 years ago ab 4.5 million nice 💥💫

sauravmahajan
Автор

Video ke starting Mai 753 subscribers dikha rha tha... 2024 Mai 6.22M 🎉🎉

manavjain
Автор

print('Please enter number')
number = int(input())
temp = number
reverse = 0

while (number>0):
dig = number%10
reverse = reverse *10 + dig
number = number /10
if temp == reverse:
print('Number is a Palindrome')
else:
print('Number is not a pallindrome')

putting this code but always getting number is not a palindrome.. please help if possible

arvindkushwaha