[Tutor] Printing with no newline :(

Dave Angel d at davea.name
Sun Nov 6 11:17:36 CET 2011


On 11/06/2011 04:45 AM, Sarma Tangirala wrote:
> On 6 November 2011 13:11, Peter Otten<__peter__ at web.de>  wrote:
>
>> Joe Batt wrote:
>>
>>> I am learning Python 3 and programming and am very new so please bear
>> <SNIP>
>>>>> for item in items:
>> ...     print(item, end="WHATEVER")
>>
>
> Another way of writing the above.
>
> for i in items:
>       print item[i], "whatever", "\n"
>
>
Nope. That would put a newline between each iteration, which is 
explicitly what the OP did not want.  More importantly, it'd give a 
syntax error in Python 3, which the OP carefully specified.

-- 

DaveA



More information about the Tutor mailing list