[Tutor] (no subject)

Volodymyr Buell vbuell at gmail.com
Thu Aug 26 08:56:47 CEST 2010


Hi Roelof,
The problem is in quotation marks. Please use plain double instead of
curly quotes. (That's a common issue when you copy-paste the code from
pdf/doc)

On Thu, Aug 26, 2010 at 9:25 AM, Roelof Wobben <rwobben at hotmail.com> wrote:
> Hello,
>
> I have this exercise :
>
>
> Try each of the following formatted string operations in a Python shell and
> record the results:
>
> “%s %d %f” % (5, 5, 5)
> “%-.2f” % 3
> “%-10.2f%-10.2f” % (7, 1.0/2)
> print ” $%5.2fn $%5.2fn $%5.2f” % (3, 4.5, 11.2)
>
>
> But if I try in a python 2.7 IDLE enviroment I get this :
>
>>>> %s %d %f % (5, 5, 5)
> SyntaxError: invalid syntax
>>>> print “%s %d %f” % (5, 5, 5)
> SyntaxError: invalid syntax
>
> Roelof
>
>
> _______________________________________________
> Tutor maillist  -  Tutor at python.org
> To unsubscribe or change subscription options:
> http://mail.python.org/mailman/listinfo/tutor
>
>

-- 
Thanks,
Volodymyr


More information about the Tutor mailing list