In [1]:
print 'hello'
In [2]:
def my_func(str_p, num_p):
return str_p + str(num_p)
In [3]:
my_func('Your age is :',32)
Out[3]:
In [4]:
9/0
In [5]:
try:
print 9/0
except Exception, why:
print why
In [6]:
def multiply(num1, num2):
return '%d x %d = %d' % (num1, num2, num1*num2)
print multiply(10,23)
In [7]:
def divide(num1, num2):
return '%d/%d = %f'%(num1,num2,float(num1)/num2)
print divide(50,40)
In [8]:
10.0/40
Out[8]:
In [8]:
In [ ]: