The first three letters · 前三个字母
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 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.
中文
前三个字母
word 是 "python"。用切片把它的前三个字符存进 part。
⚠️ 切片在第二个数之前停下。word[:3] 给出三个字符 —— 位置 0、1、2 —— 不包括位置 3。所以你写的那个数是你想要的个数,不是最后一个位置。
word is "python". Store its first three characters in part using a slice. · word 是 "python"。用切片把它的前三个字符存进 part。
Click Run to see the output here. · 点击“运行”查看此处输出。