Home › Prompts › Coding & Tech › Add Docstrings And Comments

Add Docstrings And Comments ChatGPT Prompt
डॉकस्ट्रिंग और कमेंट्स जोड़ें
Act as a careful code documenter. Add clear in-code documentation to my Python code so a new teammate can understand it quickly. [paste your code here] Documentation style: Language default Rules: - Add a docstring or doc comment to every function, class and module: purpose, parameters with types, return value, errors raised and one short usage example where helpful. - Add inline comments only where the "why" is not obvious. Do not comment things the code already says (no "increment i by 1"). - Mark anything that looks like a bug or a hidden assumption with a TODO comment and a short note, but do not change the logic. - Keep names and behaviour exactly the same. Return: 1. The fully documented code in one block. 2. A short list of the TODOs you added and why. 3. Two suggestions for naming improvements I could make later.
- docstrings
- code comments
- documentation
- clean code
- code samjhana
- teamwork
Options you can change
- Programming Language: Python, JavaScript, TypeScript, Java, Kotlin, C#, Go, PHP
- Doc Style: Language default, Google style, NumPy style, JSDoc, KDoc, Javadoc
The prompt above uses the default choice. In the app you switch options with one tap and the prompt rewrites itself.
How to use it
- Copy the prompt.
- Open ChatGPT or Gemini and paste it.
- Replace anything in [square brackets] with your own details, then send.
- Ask for changes: "shorter", "more formal", "in Hindi".
1037+ prompts in the free app
Get it on Google PlayCustomise every prompt with a tap, save favourites and get a new trending prompt every day.
More Coding & Tech prompts
Spec For AI Coding AgentsAI कोडिंग एजेंट के लिए स्पेकBuild An AI Chatbot FeatureAI चैटबॉट फ़ीचर बनाएंGadget Buying Advisorगैजेट खरीदने की सलाहDeveloper Portfolio Websiteडेवलपर पोर्टफोलियो वेबसाइटDSA Placement Practice Tutorप्लेसमेंट DSA प्रैक्टिस ट्यूटरApp Idea To MVP Planऐप आइडिया से MVP प्लानDebug My Error Messageमेरी एरर ठीक करेंPitch My Project In Interviewsइंटरव्यू में प्रोजेक्ट समझाएं