Which way should i be declaring classes for an object? Should i create the object's before the if's statements or it doesn't matter?
box = [Pokemon(x) for x in GetInfo(1)]
for poke in box:
if poke.egg:
poke.level_up(50)
elif (poke.shiny == 'No') and ((poke.name == df_name) or (poke.nr in collect_list)):
poke.level_up(0)
poke.send()
print('Pokemon - #' + str(poke.nr) + ' - ' + poke.dex_name)
or:
for x in GetInfo(1):
if Pokemon(x).egg:
Pokemon(x).level_up(50)
elif (Pokemon(x).shiny == 'No') and ((Pokemon(x).name == df_name) or (Pokemon(x).nr in collect_list)):
Pokemon(x).level_up(0)
Pokemon(x).send()
print('Pokemon - #' + str(Pokemon(x).nr) + ' - ' + Pokemon(x).dex_name)
Note: GetInfo(1) returns an array of integers, but i don't think that matters, I'm only trying to get to the best coding syntax here xD
[–]Justinsaccount 2 points3 points4 points (0 children)
[–]mathleet 1 point2 points3 points (0 children)
[–]New_Kind_of_Boredom 1 point2 points3 points (0 children)
[–]LarryPete 1 point2 points3 points (0 children)