[Tutor] print variable in quotes

Gerrit Holl gerrit@nl.linux.org
Sat Feb 22 07:22:02 2003


reavey schreef op zaterdag 22 februari om 12:54:15 +0000:
> 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"
> is to be read by a screensaver called phosphor and used in an elem 
> school to
> reinforce an early reading concept using word families.

 36 >>> a="Monty Python's flying circus"
 37 >>> print a
Monty Python's flying circus
 38 >>> print repr(a)
"Monty Python's flying circus"
 39 >>> print `a`
"Monty Python's flying circus"

yours,
Gerrit.

-- 
Asperger Syndroom - een persoonlijke benadering:
	http://people.nl.linux.org/~gerrit/
Het zijn tijden om je zelf met politiek te bemoeien:
	http://www.sp.nl/