convert integers to octal and hexadecimal strings with a string formatting expression: : Int « Data Type « Python






convert integers to octal and hexadecimal strings with a string formatting expression:

 


print "%o %x %X" % (64, 64, 255)

   
  








Related examples in the same category

1.Define and use intDefine and use int
2.Int: modulus (remainder), power Int: modulus (remainder), power
3. A value as a condition A value as a condition
4.Define and use integerDefine and use integer
5.Int value demoInt value demo
6.Convert String to integer (int)
7.Using Python as a Calculator
8.oct and hex function
9.int function
10.Compare integers using if structures, relational operators and equality operators.Compare integers using if structures, relational operators and equality operators.