#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2013
    Posts
    2
    Rep Power
    0

    Function compiling online is not showing any output


    Hi All,

    I'm new to python programming, I'm using compileonline.com to compile and execute my program.

    I tried compiling the program below,
    def hello():
    print "Hello"
    print "Computers are Fun"

    It is not showing any error or output. I am not able to execute any program with functions but if I just give the print statement I can see the output. Kindly let me know the mistake that I am doing and how to resolve it.

    Regards
    Daniel
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2013
    Location
    /dev/null
    Posts
    164
    Rep Power
    19
    Code:
    def hello():
        print "Hello"
        print "Computers are fun"
    
    hello()
    You forgot to invoke the function you wrote :-)

    (Please use code tags for code, so that indentation of code is preserved)
    Last edited by noobie1000; July 1st, 2013 at 05:38 AM.
  4. #3
  5. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2013
    Posts
    2
    Rep Power
    0

    Thanks


    Oh thanks a lot man

IMN logo majestic logo threadwatch logo seochat tools logo