Skip to content · ⁨コンテンツへスキップ⁩

Add two numbers you were given · ⁨与えられた2つの数字を加算⁩

English

Add two numbers you were given

Read two whole numbers, one per line, and print their total. For 3 and 4, print 7.

Two reads, two int(...), then one +. Forget one int and you get 34 instead of 7 — Python joined the text rather than adding the numbers.

日本語

与えられた2つの数字を加える

1行ずつ2つの整数を読み取り、その合計を出力します。3と4の場合は7を出力します。

2回の読み込み、2つの int(...) 、そして1つの + 。 int を1つ忘れると、 34 が 7 の代わりに得られます — Pythonは数字を加算するのではなくテキストをつなぎました。

Log in or create account · ⁨ログインまたはアカウント作成⁩

IGCSE, A-Level & AP