Learn how to use ChatGPT to quickly test and prototype programs.
The Python 🐍 problem-solving bootcamp is starting soon. Join the second cohort now!
ChatGPT is a large language model developed by OpenAI that has taken the world by storm. I have been playing around with ChatGPT a lot and I can say, confidently, that it has made me much more productive.
The examples that follow will show two features that I prototyped quickly for my blog by interacting with ChatGPT-4. I will share screenshots of my initial interactions with ChatGPT-4 over the TypingMind interface.
The features can be tested out in this article but they will have issues! As I said, these are just prototypes created with the help of ChatGPT! If you find any issues with these features, feel free to reach out to me or to comment below. Your help is much appreciated!
Now, bear in mind that the code wasn't perfect and I needed to tweak it, but I have enough experience programming that the prototype I was given by ChatGPT was all I needed to get started.
Things that I needed to change included the way we compute the location of the pop-up and the colours used to style it.
The pop-up is still far from perfect, but I really appreciate the fact that now I have something that I can play with.
Another feature I have wanted to add to my blog for a while is an icon in code blocks that allow copying and pasting the code inside them.
Again, a quick ChatGPT-4 interaction over TypingMind was all I needed to get me going:
To try this out, just try to copy the code in this code block:
from functools import cache @cache def fibonacci(n): if n <= 1: return 1 else: return fibonacci(n - 1) + fibonacci(n - 2)
This one is closer to the final state I would like, but I would still like to add some form of visual confirmation that the code was successfully copied.
I would like to share some brief tips on working with ChatGPT for prototyping:
These are three simple tips that I hold in my mind whenever I am playing with ChatGPT. If you have any more, feel free to let me know by commenting below!
I write about Python every week. Join +16.000 others who are taking their Python 🐍 skills to the next level 🚀, one email at a time.