sum = 3 + 4.253;
print(str(sum))
If I do this, why is the output ' 7.253". It doesn't work 7.253. Will it come out like this?
str(3 + 4.253)
If you type it like this,
' 7.253." It's printed like this, right?
If so, what you are looking for is repr()
.
print(str(3.425))
print(str('3.425'))
print(repr(3.425))
print(repr('3.425'))
© 2024 OneMinuteCode. All rights reserved.