Even or odd
此页面需较新浏览器(支持 SharedArrayBuffer)。请升级 Chrome、Edge、Firefox 或 Safari 至最新版本。
此任务基于您尚未完成的课程。请先完成以下课程:
Python 基础 · Making decisions →
奇数还是偶数
使用 int(input()) 读取一个整数 n(例如 7)。当 n 能被 2 整除且无余数时打印 even,否则打印 odd。
% 给出余数。7 % 2 是 1,8 % 2 是 0。用 ==(两个等号)来比较 —— 一个等号是赋值的意思,Python 会提醒你。
难度 1/5 · 今日首次完成可获 100 金币及少量额外奖励
Read a whole number n with int(input()) (for example 7). Print even when n divides by 2 with no remainder, and odd otherwise.
点击“运行”查看此处输出。