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

Problem 59: Snake Case to Camel Case

A string consisting of lowercase letters and underscores, such as hello_world, is given on one line. Convert it to camelCase and output it. The first word stays as-is, and each subsequent word is joined with its first letter capitalized.

Constraints

1 ≤ length of the string ≤ 100, underscores never appear at the start, at the end, or consecutively

Input example 1

hello_world

Output example 1

helloWorld

Input example 2

my_variable_name

Output example 2

myVariableName

What you'll train

Specify the output

What you get

  • Handling of the first word
  • Rule for capitalizing the first letter
  • Removing the separator character

How to ask the AI

Clearly tell the AI the conversion rule: keep the first word as-is, and only capitalize the first letter of each subsequent word before joining them.

If you ask vaguelyCapitalizing even the first word, producing HelloWorld instead of helloWorld.

あなたのコード

実行しました

プレビュー

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

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

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