The reason you are getting this error is because you are calling the randint function incorrectly, you are passing a set containing 0 and another set containing 1 and calling format method, which can only be called on a string. To use randint method you need to pass two integers as the beginning and end of the range in which you wish to get a random number. For example:
from random import *
ip1 = input('Enter the N1 :')
ip2 = input('Enter the N2 :')
r = randint(ip1,ip2)
print r
And in case you wish to print the range on screen you can do it this way:
print "{0}, {1}".format(ip1, ip2)