The last letter · 最后一个字母
This page needs a recent browser (with SharedArrayBuffer support). Please update Chrome, Edge, Firefox or Safari to the latest version. · 此页面需较新浏览器(支持 SharedArrayBuffer)。请升级 Chrome、Edge、Firefox 或 Safari 至最新版本。
This one builds on a lesson you haven't finished yet. Do that lesson first: · 此任务基于您尚未完成的课程。请先完成以下课程:
Python Basics · Python 基础 · Working with strings · 处理字符串 →
English
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.
中文
最后一个字母
word 是 "python"。把它的最后一个字符存进 last,不要自己数字母。
负数位置是从末尾开始数的:word[-1] 是最后一个字符,word[-2] 是倒数第二个。不管字符串多长都适用。
word is "python". Store its last character in last, without counting the letters yourself. · word 是 "python"。把它的最后一个字符存进 last,不要自己数字母。
Click Run to see the output here. · 点击“运行”查看此处输出。