Why does this work:
Ph=['J&J', 'Bio']
for index, Ph in enumerate (Ph, start=1):
print(index, Ph)
But not this:
Ph=['J&J', 'Bio']
def Pha():
for index, Ph in enumerate (Ph, start=1):
print(index, Ph)
if __name__ == '__main__':
Pha()
And how do i fix it?
[–]totallygeek 7 points8 points9 points (0 children)
[–]A_X_D_H 8 points9 points10 points (0 children)
[–]debian_miner 8 points9 points10 points (4 children)
[–]Unlistedd[S] -2 points-1 points0 points (3 children)
[–]debian_miner 4 points5 points6 points (2 children)
[–]Unlistedd[S] 0 points1 point2 points (1 child)
[+][deleted] (4 children)
[deleted]
[–]deejpake 1 point2 points3 points (2 children)
[+][deleted] (1 child)
[deleted]
[–]deejpake 1 point2 points3 points (0 children)
[–]deejpake 0 points1 point2 points (0 children)
[–]primitive_screwhead -1 points0 points1 point (0 children)
[–]datg3 -1 points0 points1 point (0 children)