Skip to content

Tag: for-loop

Subtracting from inner list

There is 5 fundraising projects, and the purpose of this program is to substract the amount of money that each of n donators will donate from the desired sum of each project The program partially work, but sometimes python typing “TypeError: ‘NoneType’ object is not subscriptable” and …

Iteratively apply a function to an array

I want to create an array that contains g^0, g^1, g^2…. up to g^100 but all to mod50 (apologies if anyone knows how to format this so the powers are properly aligned I need a bit of help!) In my case g = 23, so I would want an array that looks like: I’ve included all my (incorrect) code at