Extracting Educational Code Examples from Python Textbooks
摘要
Python serves as a versatile programming language due to its diverse audience. This versatility, however, has a double-edged nature as it implies a multitude of learning examples, which can quickly become overwhelming for students. To explore these examples in an educational context, we investigate their usage in Python textbooks. Our approach involves the manual curation of 1,017 chapter titles from 76 Python textbooks. The results indicate that coding examples are prevalent, making up approximately 39.5% of the content compared to other topics. We then classified the example content into four types: Application Programming Interfaces, Data and Processing, Graphical User Interfaces, and others. We also identified a list of 19 Python libraries used in these various examples. To help educators and students, we showcase PyEdu, a Python Educational Example Visualizer that uses the results of the empirical study.