[Tutor] Display all field of a listuples

Christopher Brookes chris.klaitos at gmail.com
Thu Feb 24 22:54:10 CET 2011


  Hi i would like to display all the field of my powerAll like this :

Choose a power :
Froid devorant : Embrase lenemi et le feu bruler
Flammes infernales : 'Gele lenemi sur place

-----------------------------
class Character():
  def ChoosePouvoirUnique(self):
        print ("Choose a power")
        for Power in powerAll:
            print (Power)

class Power:
    def __init__(self, name, desc):
        self.name = name
        self.desc = desc




powerAll = [
 Power('Flammes infernales' , 'Embrase lenemi et le feu bruler'),
 Power('Froid devorant', 'Gele lenemi sur place')]


But he won't display it :(

i've try   For PowerName,PowerDesc in powerAll:
                print (PowerName, PowerDesc)

but it doesn't work !

Thank you again..

-- 
Brookes Christopher.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/tutor/attachments/20110224/92602c45/attachment.html>


More information about the Tutor mailing list