โดย Four » 26/01/2018 5:14 pm
len(tuple) จำนวน element ทั้งหมดใน tuple
โค้ด: เลือกทั้งหมด
test = ("python", "mindphp", "1234")
test2 = ("python", "mindphp")
print(len(test))
print(len(test2))
max(tuple) element ที่มีค่ามากที่สุด
โค้ด: เลือกทั้งหมด
test3 = ("python", "mindphp", "tuple")
test4 = (123, 456, 789)
print(max(test3))
print(max(test4))
ผลรัน
ศึกษาข้อมูลจาก :
https://www.youtube.com/watch?v=9DP8i7x ... M&index=54
[b]len(tuple)[/b] จำนวน element ทั้งหมดใน tuple
[code]test = ("python", "mindphp", "1234")
test2 = ("python", "mindphp")
print(len(test))
print(len(test2))[/code]
[b]max(tuple)[/b] element ที่มีค่ามากที่สุด
[code]test3 = ("python", "mindphp", "tuple")
test4 = (123, 456, 789)
print(max(test3))
print(max(test4))[/code]
[b]ผลรัน[/b]
[img]http://snap.mindphp.com/index.php?view=2018Jan26_5a6afc085cdb0[/img]
ศึกษาข้อมูลจาก : https://www.youtube.com/watch?v=9DP8i7xeN7o&list=PLLi1ciqQAf8TVFbJpl7XY23lzdKrpxsMM&index=54