Even or odd
このページには最新のブラウザ(SharedArrayBuffer対応)が必要です。Chrome、Edge、Firefox、Safariを最新バージョンに更新してください。
これはまだ完了していないレッスンの先にある内容です。まずはそのレッスンを済ませてください:
Python Basics · 判断の作成 →
English
Even or odd
Read a whole number n with int(input()) (for example 7). Print even when n divides by 2 with no remainder, and odd otherwise.
% gives the remainder. 7 % 2 is 1, 8 % 2 is 0. Compare it with == (two equals signs) — one equals sign means store a value, and Python will tell you so.
難易度 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.
実行ボタンをクリックして出力を確認してください。