Artificial intelligence (AI) has become increasingly influential in computer science (CS) education, where it holds potential for automating feedback and personalized learning. AI tools have been shown to increase equitability within CS, a notoriously male-dominated field, as well as increase the programming self-efficacy of female students – which is tied to programming success. This chapter will present a summary of how students learn to code, studies explaining how AI can be used to help students understand code, as well as provide prompt feedback for students coding in real-time. A history of the development of AI and its increasing accuracy is provided. To assess the impact of generative AI for assisting students in explaining code, the authors present data from a recent study examining the effectiveness of using AI to provide code explanations for novice programmers. The authors also provide some prompt engineering suggestions for educators to help their students increase the accuracy of the results from AI queries.