itertools
Në shqip përdoret i njëjti emër.
ShpjegimiSQ
Moduli itertools ka mjete për kombinime dhe cikle: permutations() jep të gjitha renditjet, combinations() të gjitha grupet, product() të gjitha çiftet, chain() bashkon disa lista.
EnglishEN
The itertools module has tools for combinations and loops: permutations() gives every ordering, combinations() every group, product() every pairing, chain() joins several lists.
Si ta mendosh
Si t'i provosh të gjitha mënyrat si mund të ulen 3 shokë në 3 karrige.
Lexoje në anglisht
Like trying every way 3 friends could sit on 3 chairs.
Shembull kodipython
from itertools import combinations
ekipet = ["Prishtina", "Ballkani", "Drita"]
for a, b in combinations(ekipet, 2):
print(a, "vs", b)