def int2roman(num):
	"""
	Convert an integer to Roman numeral
	"""
	if not isinstance(num,int):
		raise TypeError("expected integer, got %s" % type(input))

	if not 0 < num < 4000:
		raise ValueError("Argument must be between 1 and 3999")

	ints = (1000, 900,  500, 400, 100,  90, 50,  40, 10,  9,   5,  4,   1)
	nums = ('M',  'CM', 'D', 'CD','C', 'XC','L','XL','X','IX','V','IV','I')
	result = ""
	for i,n in zip(ints, nums):
		count = int(num / i)
		result += n * count
		num -= i * count
	return result