C463/B551 Artificial Intelligence

Homework 1

Due date: Thursday, January 17, 2008.

A. Lisp option. Optional alternative for the homework in Lisp.

B. Python option.

Ex. 1 Do the Lab 1 and send me the file lab1.py.

Ex. 2 On your own: in another Python script, write a function called power taking two arguments, one which is any number (could be 0) and a second one that you can assume is an integer (could be 0 or negative). The function should print the first number raised to the power of the second number. Note that 0 to a positive power is 0, 0^0 is 1, and 0 to a negative power should print an error message. Call this to show the possible cases. Compare the results of your function with the results of the built-in function pow.

Turn in: the script written in the lab and the one you wrote on your own for the second exercise.