Skip to main content

Featured

Write a Python Program to find palindrome of a given string

If you reverse the word then you get the same word that word is palindrome. def   palindrome ( str ):     pointer =  str       rev_str =  reversed (pointer)       if   list (pointer) ==  list (rev_str):         print ( "It is palindrome" )       else :         print ( "It is not palindrome" )  palindrome( 'level' ) palindrome( 'madam' ) palindrome( 'life' ) palindrome( 'refer' ) Output:  It is palindrome It is palindrome It is not palindrome It is palindrome

Quiz

 Here are some interesting quiz you like


1. What is the output of the following assignment Operator

Y = 10

Y += 2

X = Y

print(X)

a) 12

b) 10

c) syntax Error


2. What is the output of the following

A = True

B = False

print(A or A and B)

a) True

b) False

c) Error


3. What data type is object belongs "L = [1, 23,72, 3]"

a) list

b) tuple

c) dictionary


Answer in comment section

waiting for your answers!!!

Comments

Post a Comment

Popular Posts