How do I debug the issues in my code so that my subfunction can also print?

59 Views Asked by At

This is a code of my function, I had to breakdown the main function into subfunctions. When I tested the main function it worked but not when I tried to print the output of subfunction. I tried to alter my for loop but it didn't work.

Entire function

When I tried to print just the subfunction get_relative_levels(), it just won't print anything, I am not sure if it's the problem in my for loop in this subfunction or did something wrong in my main function main()

testing outcomes

Any suggestions are appreciated!

1

There are 1 best solutions below

0
sashkins On

From the stack trace on your picture ("testing outcomes"), it looks like you are calling the get_relative_levels() function without passing any arguments to it. As per the first picture ("Entire picture"), the get_relative_levels(relative_dam_level) is designed to accept one argument. So you have to pass something (an array of numbers in your case) to the function to make it work.