CodeDrill
day_streak: --
← 問題一覧に戻る
Python ・ Standard I/O

Problem 43: Summing Comma-Separated Numbers

Integers separated by commas, such as 1,2,3, are given on one line from standard input. Output the sum of all the integers on one line.

Constraints

There are 1 to 100 integers, 0 ≤ each integer ≤ 1000

Input example 1

1,2,3

Output example 1

6

Input example 2

10,20

Output example 2

30

What you'll train

Specify the input

What you get

  • Specify the delimiter
  • Express type conversion
  • Specify the summing process

How to ask the AI

Make it clear to the AI that the input is separated by commas, not spaces. It's also safer to mention that a specific delimiter must be given to split and that the strings need to be converted to integers.

If you ask vaguelyIf the delimiter isn't specified, using the default split() will fail to split on commas.

あなたのコード

実行しました

プレビュー

AIレビュー(プロンプト練習)

コードはChatGPTやClaudeに出させたものを貼って構いません。
ここでの本番は「次にAIへ出す指示」です。評価軸は1つだけ見て、弱点・指示の穴・改善例を返します。
テストに落ちていてもレビューできます。落ちた理由と、指示に足りなかった情報を結びつけます。

先にコードを実行し、テストを1つ以上通してください。