You need parens:
(4).__str__()
The problem is the lexer thinks “4.” is going to be a floating-point number.
Also, this works:
x = 4
x.__str__()
More Related Contents:
- Accessing attributes on literals work on all types, but not `int`; why? [duplicate]
- Change sign of elements with an odd sum of indices
- How to add a label to all words in a file? [closed]
- How to remove English words from a file containing Dari words?
- Function Arguments – Clarification
- How can I read inputs as numbers?
- Using both Python 2.x and Python 3.x in IPython Notebook
- What do ellipsis […] mean in a list?
- Why is a list comprehension so much faster than appending to a list?
- Why is parenthesis in print voluntary in Python 2.7?
- Why does str(float) return more digits in Python 3 than Python 2?
- Backporting Python 3 open(encoding=”utf-8″) to Python 2
- pip or pip3 to install packages for Python 3?
- operator.itemgetter or lambda
- How to print a list with integers without the brackets, commas and no quotes? [duplicate]
- How do I run python 2 and 3 in windows 7? [duplicate]
- Python3 correct way to import relative or absolute?
- Is Python’s order of evaluation of function arguments and operands deterministic (+ where is it documented)?
- Pip freeze vs. pip list
- PyOpenGL glutInit NullFunctionError
- How to apply a function to each sublist of a list in python?
- Python 3 urllib produces TypeError: POST data should be bytes or an iterable of bytes. It cannot be of type str
- How to read the last line of a file in Python? [duplicate]
- Multiple keys per value
- Type error Unhashable type:set
- Loading text file containing both float and string using numpy.loadtxt
- What is absolute import in python?
- Run process with realtime output to a Tkinter GUI
- What does the slice() function do in Python?
- Skip elements on a condition based in a list comprehension in python