[Tutor] print variable in quotes
Gregor Lingl
glingl@aon.at
Sat Feb 22 07:05:01 2003
reavey schrieb:
> hi
> I need help printing a variable in quotes.
> pre = "FGRTPQMK"
> suf = "ack"
> for elem in pre:
> print "echo " elem+suf
>
> I'd like to get the variable elem+suf in double qoutations?
> The output I'd like to see:
> echo "Fack"
> echo "Gack"
(1) print 'echo "' + elem + suf + '"'
or
(2) print 'echo "%s"' % (elem+suf)
Regards, Gregor
>
> is to be read by a screensaver called phosphor and used in an elem
> school to
> reinforce an early reading concept using word families.
>
> thanks
> re-v
>
>
>
>
> _______________________________________________
> Tutor maillist - Tutor@python.org
> http://mail.python.org/mailman/listinfo/tutor
>
>