The first three letters · สามตัวอักษรแรก
The first three letters
word is "python". Store its first three characters in part using a slice.
⚠️ A slice stops before its second number. word[:3] gives three characters — positions 0, 1, 2 — and never position 3. So the number you write is the COUNT you want, not the last position.
สามตัวอักษรแรก
word คือ "python". เก็บสามตัวอักษรแรก ใช้ slice在下 part
⚠️ Slice จะหยุด ก่อน ตัวเลขที่สอง. word[:3] ให้สามตัวอักษร — ตำแหน่ง 0, 1, 2 — และไม่ pernahตำแหน่ง 3. ดังนั้นตัวเลขที่คุณเขียนคือ COUNT ที่คุณต้องการ, ไม่ใช่ตำแหน่งสุดท้าย
word is "python". Store its first three characters in part using a slice. · word คือ "python". เก็บสามตัวอักษรแรก ใช้ slice在下 part
Click Run to see the output here. · คลิก Run เพื่อดูผลลัพธ์ที่นี่