[Tutor] Dictionnaries in object

Christopher Brookes chris.klaitos at gmail.com
Thu Feb 24 19:58:00 CET 2011


Hi,

I want to create some powers in my fight program.
I want to know if dictionnaries is the best solution to do it.

For now its look like this :


//French name and description, don't care about it ;)

power1= {}
power1['Name'] = 'Flammes infernales'
power1['Description'] = 'Embrase lenemi et le feu bruler'

power2= {}
power2['Name'] = 'Froid devorant'
power2['Description'] = 'Gele lenemi sur place'

powerAll= [power1,power2]

but if i want to create like 20 powers, it will be long no ? is there any
solution shorter (and better ?)

Thank you for reading,

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


More information about the Tutor mailing list