Python: Facts

Example: Facts Prolog

The following is the Prolog source code I saved in a file named


In the SWI-Prolog program, I think clicked File > Consult and then opened the file. I then typed in the line animal(dog,beatle). which returned true. Then, I typed in animal(dog,X) to get all the dogs. You must type in a ; to get the next line.

screenshot of Facts Prolog