Python menu example with a simple script

Hi Friends Today I have worked with python to create a simple menu.

Here is the python menu example :

import sys

print “””Choose a choice to get the capital of states

Choose 1) for Tamil Nadu

Choose 2) for Karnataka”””

answer = raw_input(“Make a selection> “)

if “1” in answer: print “Chennai”

elif “2” in answer: print “Bangalore”

Where Output will be like :

Choose a choice to get the capital of states

Choose 1) for Tamil Nadu

Choose 2) for Karnataka

Make a selection> 1

Chennai

  • i agree with your conclusions and will eagerly look forward to your incoming updates. just saying thanks will not just be enough, for the phenomenal clarity in your writing.