Mega Code Archive

 
Categories / Python Tutorial / String
 

Left justify

hexStr = "3f8" print "\nHex String: " + hexStr.upper().ljust(8,'0')