A number from input · 读入一个数
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 基础 · Getting input · 获取输入 →
English
A number from input
Read a whole number and print it doubled. For the input 7, print 14.
⚠️ input() always gives back text, even when you typed digits — "7" * 2 is "77". Wrap it in int(...) to get a number you can do arithmetic with.
中文
读入一个数
读取一个整数,打印它的两倍。输入 7 时,打印 14。
⚠️ input() 永远返回文字,哪怕你输入的是数字 —— "7" * 2 得到的是 "77"。用 int(...) 包起来,才能得到可以做运算的数。
Read a whole number and print it doubled. For the input 7, print 14. · 读取一个整数,打印它的两倍。输入 7 时,打印 14。
Click Run to see the output here. · 点击“运行”查看此处输出。