def findFactorial( num ):
	temp = num
	fact = 1
	while temp > 0:
		fact = fact * temp
		temp = temp - 1
	else:
		print "Factorial of num: ", fact
	return

n = input("Enter number: ")

findFactorial(n)

#=====================================================================================================

# Function definition
def changeme( mylist ):
   mylist.append([1,2,3,4]);
   return

# call function
mylist = [10,20,30];
print "Values before function call: ",mylist
changeme( mylist );
print "Values after function call: ", mylist

#Required Arguments

# Function definition is here
def printme( str ):
   "This prints a passed string into this function"
   print str
   return;

# Now you can call printme function
printme( str = "My string")


#Keyword As Parameter

#!/usr/bin/python

# Function definition is here
def printinfo( name, age ):
   "This prints a passed info into this function"
   print "Name: ", name
   print "Age ", age
   return;

# Now you can call printinfo function
printinfo( age=50, name="miki" )

#Default Argument

# Function definition is here
def printinfo( name, age = 35 ):
   "This prints a passed info into this function"
   print "Name: ", name
   print "Age ", age
   return;

# Now you can call printinfo function
printinfo( age=50, name="miki" )
printinfo( name="miki" )

#Variable Length Argument

# Function definition is here
def printinfo( arg1, *vartuple ):
   "This prints a variable passed arguments"
   print "Output is: "
   print arg1
   for var in vartuple:
      print var
   return;

# Now you can call printinfo function
printinfo( 10 )
printinfo( 70, 60, 50 )

#Anonymous Function

# Function definition is here
sum = lambda arg1, arg2: arg1 + arg2;

# Now you can call sum as a function
print "Value of total : ", sum( 10, 20 )
print "Value of total : ", sum( 20, 20 )

#Return Statement

# Function definition is here
def sum( arg1, arg2 ):
   # Add both the parameters and return them."
   total = arg1 + arg2
   print "Inside the function : ", total
   return total;

# Now you can call sum function
total = sum( 10, 20 );
print "Outside the function : ", total 
