การคืนค่า tuple ทำได้โดยการใส่ค่าที่ต้องการในวงเล็บหรือใช้ comma แยกค่า
ตัวอย่าง
def foo():
str_val = "tutorialspoint"
x = 30
return (str_val, x)
print(foo())
ผลลัพธ์
('tutorialspoint', 30)
Python จะจัดการ tuple โดยอัตโนมัติเมื่อมี comma คั่นค่าใน return statement