def chooseCompPkmn(): compChoice = Pokemon.choosePokemon(pkmnObjects) compPkmn = pkmnObjects[compChoice] '''for y in pkmnObjects: if y.getName() == userChoice: #print("MATCH") userPkmn = y break''' for x in range(len(pkmnObjects)): if compPkmn == userChoice: compChoice = Pokemon.choosePokemon(pkmnObjects) compPkmn = pkmnObjects[compChoice] return compPkmn