On Thu, 18 Aug 2016 10:58 pm, ast wrote:

> Hello
> 
> I wonder why calling a method on an integer
> doesn't work ?
> 
>>>> 123.bit_length()
> SyntaxError: invalid syntax


Because Python thinks you are writing a float, and "b" is not a valid digit.

Try:


(123).bit_length()

123 .bit_length()


instead.


-- 
Steve
“Cheer up,” they said, “things could be worse.” So I cheered up, and sure
enough, things got worse.

-- 
https://mail.python.org/mailman/listinfo/python-list

Reply via email to