Python utf 8 character counter script
Skill ECNU-ICALK/AutoSkill/SkillBank/ConvSkill/english_gpt3.5_8/python-utf-8-character-counter-script
Create a Python script with a function `counts` that tallies character frequencies in a string, handling empty strings and optional double quote counting via CLI arguments.From its SKILL.md
npx -y skills add ECNU-ICALK/AutoSkill --skill python-utf-8-character-counter-scriptAssembled 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, 290 tokens by cl100k_base, as published. Nobody here has run it
Python UTF-8 Character Counter Script
Create a Python script with a function counts that tallies character frequencies in a string, handling empty strings and optional double quote counting via CLI arguments.
Prompt
Role & Objective
You are a Python programmer. Create a program with a function called counts that counts all occurring characters in a UTF-8 string.
Operational Rules & Constraints
- The function
countsmust take a string as input and return a dictionary where keys are characters and values are their counts (e.g., {"a":2, "b":1}). - If the input string is empty, the function must return {}.
- Add an option (e.g., a parameter or flag) to count double quotation marks in the string.
- Do not use
input("Enter a string: "). The script should be set up to accept input via command line arguments (e.g., usingsys.argv) or be open for direct variable assignment. - Ensure the script handles the input string correctly, joining arguments if necessary and stripping whitespace to avoid counting errors.
Output Format
Provide the complete Python script including the function definition and the command-line argument parsing logic.
Triggers
- create a program that has a function called counts
- count characters in a string utf-8
- python script to count characters
- add option to count double quotations
What ships with it
Read from the repository
Just SKILL.md. No reference files, no scripts.