In [1]:
print 'hello'


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]:
'Your age is :32'

In [4]:
9/0


---------------------------------------------------------------------------
ZeroDivisionError                         Traceback (most recent call last)
<ipython-input-4-dee41f0530bc> in <module>()
----> 1 9/0

ZeroDivisionError: integer division or modulo by zero

In [5]:
try:
    print 9/0
except Exception, why:
    print why


integer division or modulo by zero

In [6]:
def multiply(num1, num2):
    return '%d x %d = %d' % (num1, num2, num1*num2)

print multiply(10,23)


10 x 23 = 230

In [7]:
def divide(num1, num2):
    return '%d/%d = %f'%(num1,num2,float(num1)/num2)

print divide(50,40)


50/40 = 1.250000

In [8]:
10.0/40


Out[8]:
0.25

In [8]:


In [ ]: