some problems for an introductory python test

Hope Rouselle hrouselle at jevedi.com
Tue Aug 10 17:27:15 EDT 2021


Terry Reedy <tjreedy at udel.edu> writes:

> On 8/10/2021 9:15 AM, Hope Rouselle wrote:
>>>>> 2.__add__(3)
>> SyntaxError: invalid syntax
>> But then I tried:
>> 
>>>>> (2).__add__(3)
>> 5
>
> Add a space is easier.
>>>> 2 .__add__(3)
> 5
>>>>

Hah.  That's brilliant!  So cool.


More information about the Python-list mailing list