Jan-13-2020, 11:16 PM
Couple things to start. The assignment says your PolCal should take one argument, not two. In line 20 you will then call it on b, which is the list you generated in the first part.
Second, whenever you are tempted to use range(len(x)), don't. You can say for i in li and it does the same thing, easier to read, easier to debug. It is also a very good idea to use descriptive variable names. We've come a long way from Fortran where variables starting with "i" through "n" were integers and the rest floats.
PolCal also needs to return two lists. You are returning one single value. Read that part of the assignment again and think about what you want to generate, and then how.
Second, whenever you are tempted to use range(len(x)), don't. You can say for i in li and it does the same thing, easier to read, easier to debug. It is also a very good idea to use descriptive variable names. We've come a long way from Fortran where variables starting with "i" through "n" were integers and the rest floats.
PolCal also needs to return two lists. You are returning one single value. Read that part of the assignment again and think about what you want to generate, and then how.