Divisible by both · 能同时整除
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 基础 · Making decisions · 做出判断 →
English
Divisible by both
n is 12. Print yes when n divides exactly by both 3 and 4, and no otherwise.
This is the shape a leap-year test is built from: a remainder question, == 0, and and between two of them. Each side must be a whole question — n % 3 == 0 and n % 4 == 0.
中文
能同时整除
n 是 12。当 n 同时能被 3 和 4 整除时打印 yes,否则打印 no。
闰年判断就是用这个形状搭起来的:一个求余数的判断、== 0,再用 and 把两个连起来。每一边都要是完整的判断 —— n % 3 == 0 and n % 4 == 0。
n is 12. Print yes when n divides exactly by both · 两者 3 and 4, and no otherwise. · n 是 12。当 n 同时能被 3 和 4 整除时打印 yes,否则打印 no。
Click Run to see the output here. · 点击“运行”查看此处输出。