Skip to content

Instantly share code, notes, and snippets.

@Robofied
Created February 10, 2019 08:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Robofied/7804d87db0ff75341dd3768e82425fd4 to your computer and use it in GitHub Desktop.
Save Robofied/7804d87db0ff75341dd3768e82425fd4 to your computer and use it in GitHub Desktop.
Intermediate Python
## 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