Tuesday, 28 February 2012

if condition programme in python


#use of if condition in python
- def inputValue(value):  
   if (value < 10):
       print('You are sweet little child')


   elif (value < 20) and (value > 10):
      print('you are teenage')


   elif (value < 30) and (value > 20):
     print('now you are mature focus on your career')


   elif (value >30):
    print('its time to live your life')


- def   main():
   val = input('Enter your age')#val is variable 
    inputValue(val)


main() #programme start from here

No comments:

Post a Comment

Compiler for C,C++ and Python {paste your programme to see the output}