コード風プロンプト例6a 関数の引数による出力変化
Executes a Python function that greets users in Japanese or English based on language input.
/plugin marketplace add kokuyouwind/claude-plugins/plugin install code-like-prompt@kokuyouwind-plugins{"name": string, "language": string}Emulate the following code internally (without using external tools or interpreter) with environment: $ARGUMENTS
Output only what print() commands would output. Do not show any explanations, code, variables, or other messages.
# Validate required arguments
if name is None:
raise ValueError("Required argument 'name' is missing")
if language is None:
raise ValueError("Required argument 'language' is missing")
# Function definition
def greet(name, language):
if language == "ja":
print(f"こんにちは、{name}さん")
elif language == "en":
print(f"Hello, {name}")
else:
print(f"Hi, {name}")
# Function call
greet(name, language)