The last letter · האות האחרונה
The last letter
word is "python". Store its last character in last, without counting the letters yourself.
A negative position counts from the end: word[-1] is the last character, word[-2] the one before it. It works whatever the length.
האות האחרונה
המילה היא "python". אחסן את האות אחרונה שלה ב-last, מבלי לספור אותיות בעצמך.
מיקום שלילי סופר מהסוף: word[-1] היא האות האחרונה, word[-2] היא זו שקדמה לה. הדבר עובד בכל אורך.
word is "python". Store its last character in last, without counting the letters yourself. · המילה היא "python". אחסן את האות אחרונה שלה ב-last, מבלי לספור אותיות בעצמך.
Click Run to see the output here. · לחץ על הרץ כדי לראות את התוצא כאן.