Learn Python Easy Way
Monday, March 28, 2016
number literals in python: hex, octal, and binary
http://stackoverflow.com/questions/1476/how-do-you-express-binary-literals-in-python
hex: 0x11 : using 0x
octal: 011 : starting with 0
binary: 0b11 : starting with 0b
print 0x11 => 11
print 011 => 9
print 0b11 => 3
No comments:
Post a Comment
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment