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

Problem 11: Repeating a String

You are given a string S on the first line and an integer N on the second line. Output, on one line, the string formed by repeating S N times and concatenating the results.

For example, if S is abc and N is 3, the answer is abcabcabc.

Constraints

1 ≤ length of S ≤ 20, 1 ≤ N ≤ 10

Input example 1

abc
3

Output example 1

abcabcabc

Input example 2

x
1

Output example 2

x

What you'll train

Specify the output

What you get

  • Clarify the output format
  • Specify whether to include a newline
  • Explain how to join the strings

How to ask the AI

Clearly tell the AI the output format: concatenate S repeated N times with no separator, and print it all on one line. It's also good to specify that the result should be an empty string when N=0.

If you ask vaguelyWhen N=0, the AI might produce an error or unwanted output instead of an empty string.

あなたのコード

実行しました

プレビュー

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

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

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