Aug-19-2019, 01:28 PM
Hello! I am a Junior in Python. I am doing my first steps.
Please help with repr(function).
I read in Python book that repr() must return "real" meaning.
For example (from book):
>>> num = 1 / 3
>>> repr(num)#
‘0.33333333333333331’
>>> str(num) #
‘0.333333333333’
I tried to use repr() in Sublime Text Editor and in interactive python mode/ But result is same. I receive only 0.333333333333, but never ‘0.33333333333333331’.
I use Python 3.7.2 ver.
Thank you very much for support!
Valentina!
Please help with repr(function).
I read in Python book that repr() must return "real" meaning.
For example (from book):
>>> num = 1 / 3
>>> repr(num)#
‘0.33333333333333331’
>>> str(num) #
‘0.333333333333’
I tried to use repr() in Sublime Text Editor and in interactive python mode/ But result is same. I receive only 0.333333333333, but never ‘0.33333333333333331’.
I use Python 3.7.2 ver.
Thank you very much for support!
Valentina!