Function compiling online is not showing any output

A forum for general discussion of the Python programming language.

Function compiling online is not showing any output

Postby daniel_12 » Mon Jul 01, 2013 6:50 am

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
daniel_12
 
Posts: 1
Joined: Mon Jul 01, 2013 6:44 am

Re: Function compiling online is not showing any output

Postby metulburr » Mon Jul 01, 2013 6:59 am

i am guessing you defined the function but never called it

Code: Select all
def hello():
  print "Hello"
  print "Computers are Fun"
 
hello()

the last line here is calling the function
New Users, Read This
OS Ubuntu 14.04, Arch Linux, Gentoo, Windows 7/8
https://github.com/metulburr
steam
User avatar
metulburr
 
Posts: 1423
Joined: Thu Feb 07, 2013 4:47 pm
Location: Elmira, NY


Return to General Discussions

Who is online

Users browsing this forum: Google [Bot] and 3 guests