Nov-20-2019, 01:42 AM
Well, there are two things that could cause errors that I see. One, line 5 needs to be indented or you will get an indentation error. Two, your recursive function has no stop case, so it will recurse forever, and eventually cause a recursion error. For example, take power(3, 2). That will call power(3, 1), which will call power(3, 0), which will call power(3, -1), which will call power(3, -2), and so on. You want to stop and just return n when p == 1.
Craig "Ichabod" O'Brien - xenomind.com
I wish you happiness.
Recommended Tutorials: BBCode, functions, classes, text adventures
I wish you happiness.
Recommended Tutorials: BBCode, functions, classes, text adventures