Monday, September 10, 2012

python how to use if else , simple example


a  = input()
if a == 'ramesh':
    print ('hi '+a)
elif  a == 'babu':
    print ('hi '+a+' ela unnavu')
else :
    print ('hi ')


save it with ifelse.py and run using f5 

No comments:

Post a Comment