Python code for Artiﬁcial Intelligence – Part : 2 : We use Python because Python programs can be close to pseudo-code. It is designed for humans to read. Python is reasonably efﬁcient. Efﬁciency is usually not a problem for small examples. If your Python code is not efﬁcient enough, a general procedure to improve it is to ﬁnd out what is taking most the time, and implement just that part more efﬁciently in some lower-level language. Most of these lower level languages interoperate with Python nicely. This will result in much less programming and more efﬁcient code (because you will have more time to optimize) than writing everything in a low-level language. You will not have to do that for the code here if you are using it for course projects.
Python code for Artiﬁcial Intelligence – Part : 2 : Getting Python : Next, install the Python 3 interpreter on your computer. This is the program that reads Python programs and carries out their instructions; you need it before you can do any Python programming. Mac and Linux distributions may include an outdated version of Python (Python 2), but you should install an updated one (Python 3). See Beginners Guide/Download for instructions to download the correct version of Python.