mardi 3 mars 2015

How do I invoke a for loop in a method with argument "self"



def commandType(self):
'''P.commandType() -> str
'''
for i in self:
.........


I want to write a for loop such that I am able to loop through the Contents of "P" object. What is the best way to call it in python. PS: ignore the PASS command.


Which one For i in self: or for i in P: work?





Aucun commentaire:

Enregistrer un commentaire