หน้า 1 จากทั้งหมด 1

ตัวดำเนินการของตัวแปร List

โพสต์แล้ว: 17/01/2018 4:35 pm
โดย Four
บทเรียน python บทที่ 6 https://www.youtube.com/watch?v=pZ788u6 ... lzdKrpxsMM

โค้ด: เลือกทั้งหมด

list1 = ["Mindphp", "test", 10, 20]
list2 = [10, 20, 30, 40]

print (len(list1))
print (len(list2))

print (list1 + list2)

print (list1 * 2)

print ("test" in list2)

for a in list1:
    print (a)
ผลรัน

รูปภาพ