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.
שלושת האותות הראשונות
המילה היא "python". אחסן את שלושת האותות הראשונות שלה ב-part באמצעות פרוק (slice).
⚠️ פרוק עצור לפני המספר השני שלו. word[:3] נותן שלושה איברים — המיקומים 0, 1, 2 — ולעולם לא את המיקום 3. לכן המספר שכותבים הוא ה-כמות הרצויה, לא המיקום האחרון.
word is "python". Store its first three characters in part using a slice. · המילה היא "python". אחסן את שלושת האותות הראשונות שלה ב-part באמצעות פרוק (slice).
Click Run to see the output here. · לחץ על הרץ כדי לראות את התוצא כאן.