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

Problem 31: Counting Vowels

A string S is given on a single line from standard input. Output, on one line, the number of vowels (a, i, u, e, o) contained in S.

For example, hello contains e and o, so the answer is 2.

Constraints

1 ≤ length of S ≤ 100 (S consists only of lowercase English letters)

Input example 1

hello

Output example 1

2

Input example 2

aeiou

Output example 2

5

What you'll train

Cover the edge cases

What you get

  • Define the target characters
  • Check uppercase vs lowercase handling
  • Specify the output format

How to ask the AI

The vowels are only the 5 letters a, i, u, e, o. If uppercase letters like A or E appear, tell the AI specifically whether they should be counted or not. It's also reassuring to confirm what should be output when there are no vowels at all.

If you ask vaguelyIf you don't specify whether uppercase vowels should be counted, the AI may only target lowercase letters, causing some vowels to be missed.

あなたのコード

実行しました

プレビュー

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

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

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