Tuesday, 17 September 2013

Python error in functions

Python error in functions

I am an absolute beginner in python. I was practicing simple python code
of functions from a tutorial. But I am getting some wierd error when i try
running this code snippet from terminal. What is the role of main in this
can someone explain me?
def donuts(count):
if count < 10:
return 'Number of donuts: ' +str(count)
else:
return 'Number of donuts: many'
if __name__ == '__main__':
main()

No comments:

Post a Comment