variable sub in a list- how to

Gabriel Genellina gagsl-py2 at yahoo.com.ar
Thu Jun 21 21:35:40 EDT 2007


En Thu, 21 Jun 2007 22:16:59 -0300, hari sirigibathina  
<hari.siri74 at gmail.com> escribió:

> How can I substitute a variable into a list ?
> ex:
> list()
> var = 'Prog'
> list.append($Prog) //error occur here

Considering the usage of // and $Prog (btw, did you meant $var?) I think  
you should start by reading some introductory texts, like the Python  
Tutorial <http://docs.python.org/tut/> or Dive Into Python  
<http://www.diveintopython.org/>, to learn how things are done in Python.

-- 
Gabriel Genellina




More information about the Python-list mailing list