Check whether a list is palindrome or not. Also print the reverse list.

Asked: Anonymously |Category: Python

n = eval(input("Enter the no. of elements you want."))

l1 = list()

l2 = list()

for i in range(n):

l1.append(eval(input("Enter the element for first list:")))

l2=l1[::-1]

print(l2)

if(l2==l1):

print("Palindrome")

else:

print("Not Palindrome")

6 views

Recent Posts

See All

"Believe you can and you're halfway there"