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

Top 5 movies using python

 In this post lets see a small program to show top 10 movies

Top 10 movies

Imdb is a online database of information system related to movies, games, tv shows etc..

First lets import imdb:

pip install IMDbPY

Code:

import imdb

ia= imdb.IMDb()

movie= ia.get_top250_movies()

for i in range(5):

      print(movie [i])

Output:

The Shawshank Redemption
The Godfather The Godfather: Part II The Dark Knight 12 Angry Men

Comments

Popular Posts