python: int object is not subscriptable
Go to solution
Solved by Claryn,
ALRIGHTY
problem solved:
As a novice in Python, but quite intermediate in Java, I made the stupid mistake of thinking that Python would not look at numCoins here:
numCoins = [20,10,5,1] coins = [0] *len(numbers) for i in range(len(coins)): coins[i] = numCoins
and treat it as a pointer. I ended up with a list that contained a duplicate of the list numCoins. Fucked me over big time.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now