Lesson 2: Different Types of AI
Code
Generative AI can be very useful for generating code and many LLMs (like OpenAI's GPT models) have been trained on huge amounts of code from the internet.
Generative AI code tools can:
- Generate complete programs or small snippets of code from a simple text prompt.
- Write in many different programming languages, such as Python and JavaScript.
- Help students learn new coding concepts by providing examples and guidance.
Beyond just writing new programs, generative AI is also an excellent tool for explaining how existing code works. The image below shows an example conversation with ChatGPT, where we have asked it to explain how loops in Python code work.
You may have heard of Vibe Coding before. This is a term that means that you let the AI generate the code, without really understanding how it works. This can be a fun and quick way to create code and apps. But it's important to read the generated code and understand how the code works, in case it doesn't work as you expect.
On the next page, you will generate some Python code. You will also learn more about vibe coding and using AI to help you write code in a future lesson.