Created
April 10, 2020 10:56
-
-
Save rishisidhu/67a80467b7cf4773c6725aefa6bf96f0 to your computer and use it in GitHub Desktop.
Integers in Python
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
a = 10 # Integer | |
b = -9 # Integer can be negative | |
c = 0b011 # Integer can be Binary | |
d = 0o123 # Integer can be Octal | |
e = 0x9AF # Integer can be Hexadecimal | |
print("Positive Integer = ",a, " | ", type(a)) | |
print("Negative Integer = ",b, " | ", type(b)) | |
print("Binary Integer = ",c, " | ", type(c)) | |
print("Octal Integer = ",d, " | ", type(d)) | |
print("Hexadecimal Integer = ",e, " | ", type(e)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment