Exploring the Intersection of AI and Physics: The Role of ChatGPT in Code Generation