Python is a well capable language and you can certainly also build Pacman in Python using modules such as Pygame and using the Random library.