> Good evening! I am trying to pass a number variable and have it > converted to hex. Any recommendations on how to achieve this?
You appear to have answered your own question below. What exactly is the problem? FAILS ---------- >>> value = 1234567890 >>> hexoutput = hex('%d' % (value)) WORKS ------------- >>> hexoutput = hex(1234567890) Are you trying to insert a hex representation of the number into a string for printing? If so the easiest way is using string format characters: >>> print "In hex: %d = %X" % (42,42) In hex: 42 = 2A HTH, Alan G Author of the Learn to Program web tutor http://www.freenetpages.co.uk/hp/alan.gauld _______________________________________________ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor