Skip to content · ⁨ข้ามไปยังเนื้อหา⁩

The first three letters · ⁨สามตัวอักษรแรก⁩

English

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 ที่คุณต้องการ, ไม่ใช่ตำแหน่งสุดท้าย

Log in or create account · ⁨เข้าสู่ระบบหรือสร้างบัญชี⁩

IGCSE, A-Level & AP