functions in python

import time import calendar # functions should be defined before the call def printme (print_in): print (print_in,'\n') return def show_calendar (year,month): cal=calendar.month(year,month) printme (cal) return def addme (a,b): c=a+b return c printme (time.localtime()); # function call printme('saket') show_calendar(2000,2) sum=addme(1,2) printme(sum)
This snippet shows how to create and call functions in python

Be the first to comment

You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.