Created
February 10, 2019 08:31
-
-
Save Robofied/7804d87db0ff75341dd3768e82425fd4 to your computer and use it in GitHub Desktop.
Intermediate 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
## Creating a variable contains numerical value | |
a = 1/9 | |
## printing that variable using str() then it will give simple output | |
## In this numerical value case both str and repr are giving same results. | |
print(str(a)) | |
#[Output]: | |
#0.1111111111111111 | |
## printing that variable using str() then it will give simple output | |
## In this numerical value case both str and repr are giving same results. | |
print(repr(a)) | |
#[Output]: | |
#0.1111111111111111 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment