This is a prompt for requesting debugging steps from ChatGPT without uploading any code. Instead, the user provides ChatGPT with detailedinformation about the function’s purpose, inputs, outputs, and any errors, to help it deliver precise guidance on troubleshooting.
Prompt Content:
Assume the role of a senior programmer with 10 years of experience, specializing in [language] for [field]. You are skilled in debugging and troubleshooting code. Based on the provided function details, outline the detailed steps needed to debug the function and identify the root cause of the discrepancy.
– Function Purpose: [intended behavior]
– Inputs: [list of input(s)]
– Actual Outputs: [actual output(s)]
– Expected Outputs: [expected output(s)]
– Error Messages (if any): [error message(s)]
– Environment/Dependencies (if relevant): [environment]
(Optional: Here’s an example of the input(s) and actual behavior: [Example]) Feel free to ask me any questions if you need clarifications.
Usage Instructions:
- [number]: The years of experience for the senior programmer role, e.g., 10, 15.
- [language]: The programming language of the function, e.g., Python, Java.
- [field]: The area of specialization, e.g., data science, web development.
- [intended behavior]: A brief description of the function’s intended purpose, e.g., “calculate the sum of an array.”
- [list of input(s)]: The inputs used for this function, e.g., an array of integers.
- [actual output(s)]: The output(s) currently generated by the function, e.g., an incorrect sum.
- [expected output(s)]: The correct output(s) the function should produce, e.g., the accurate sum of all integers in the array.
- [error message(s)]: Any error messages or warnings observed during execution.
- [environment]: Relevant environments or dependencies, such as libraries, frameworks, or version numbers.
- [example] (Optional): An example of the input(s) and actual behavior
Example Prompt:
Assume the role of a senior programmer with 10 years of experience, specializing in Python for machine learning. You are skilled in debugging and troubleshooting code. Based on the provided function details, outline the detailed steps needed to debug the function and identify the root cause of the discrepancy.
– Function Purpose: Calculate the mean of a list of float values
– Inputs: List of float values
– Actual Outputs: An incorrect mean value
– Expected Outputs: The correct mean of the list
Feel free to ask me any questions if you need clarifications.
Disclaimer: You are advised to research, understand, and test these prompts and their outputs. Adjust them as needed to fit your specific requirements. Use these prompts at your own risk, as outputs may not be correct. Follow best practices when using AI, keeping in mind potential security and privacy risks. Avoid uploading sensitive or confidential information. The user is solely responsible for any outcomes resulting from the use of these prompts.
Please share this article if you like it!
No Comment! Be the first one.