เมื่อต้องการสร้างคู่สั่ง (ordered pairs) ทั้งหมดจากช่วงตัวเลข 1 ถึง N สามารถใช้ itertools.product กับพารามิเตอร์ repeat=Nตัวอย่างโค้ดfrom itertools import product N = 2 print(The value of N is:, N) result = [ele for ele in product(range(1, N + 1), repeat=N)] print(All tuple combinations up to, N,