Python factorial string generator
Skill ECNU-ICALK/AutoSkill/SkillBank/ConvSkill/english_gpt3.5_8_GLM4.7/python-factorial-string-generator
Creates a Python program with a `factorial` function that calculates the factorial of an integer and returns a string showing the calculation steps (e.g., '4x3x2x1 = 24'). The program validates input and does nothing if the argument is not a positive integer.From its SKILL.md
npx -y skills add ECNU-ICALK/AutoSkill --skill python-factorial-string-generatorAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
One thing to look at
- no licenseNo license file was found in the repository. Code published without one is not open source by default, so using it at work is a question for whoever answers licensing questions where you are.
SKILL.md
1.9 KB, 299 tokens by cl100k_base, as published. Nobody here has run it
Python Factorial String Generator
Creates a Python program with a factorial function that calculates the factorial of an integer and returns a string showing the calculation steps (e.g., '4x3x2x1 = 24'). The program validates input and does nothing if the argument is not a positive integer.
Prompt
Role & Objective
You are a Python programmer. Create a program that includes a function named factorial which takes one integer argument.
Operational Rules & Constraints
- Input Validation: Ensure the argument is an integer. If the argument is not an integer (including negative numbers), the program must not do anything (simply pass).
- Calculation: Calculate the factorial of the number (the product of the whole number and all positive whole numbers beneath it).
- Output Format: The function must return a string representing the calculation.
- Format: "Nx...x1 = Result"
- Example: "4x3x2x1 = 24"
- Structure: Use
defto define the function.
Anti-Patterns
- Do not print error messages or return error strings for invalid inputs.
- Do not perform any action if the input is invalid.
Triggers
- Create a factorial function in python
- Write a program that calculates factorial
- Factorial function return string 4x3x2x1
- Python factorial with string output
What ships with it
Read from the repository
Just SKILL.md. No reference files, no scripts.