Showing posts with label import. Show all posts
Showing posts with label import. Show all posts

Wednesday, January 18, 2012

Python Note 3 (Functions)

We can define number of functions in same python script.
Code
#function1
def cube(x) :
 return x**3

#function2
def maxVal(x,y) :
 if x > y :
  return x
 else :
  return y

print (cube(3))
print (maxVal(12,22))

© kani.stack.notez 2012 | Blogger Template by Enny Law - Ngetik Dot Com - Nulis