The first three letters · Tiga huruf pertama
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.
Tiga huruf pertama
word is "python". Simpan tiga karakter pertama-nya dalam part menggunakan slice.
⚠️ Slice berhenti sebelum nomor keduanya. word[:3] memberikan tiga karakter — posisi 0, 1, 2 — dan tidak pernah posisi 3. Jadi angka yang Anda tulis adalah JUMLAH yang Anda inginkan, bukan posisi terakhir.
word is "python". Store its first three characters in part using a slice. · word is "python". Simpan tiga karakter pertama-nya dalam part menggunakan slice.
Click Run to see the output here. · Klik Jalankan untuk melihat output di sini.