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 أبداً. لذا الرقم الذي تكتبه هو الـ COUNT الذي تريده، وليس آخر موقع.
word is "python". Store its first three characters in part using a slice. · الكلمة هي "python". احفظ أول ثلاثة أحرف في part باستخدام شريحة (slice).
Click Run to see the output here. · اضغط تشغيل لرؤية المخرجات هنا.