Skip to content Skip to sidebar Skip to footer

Typeerror: Can Only Concatenate List (not "int") To List 4

I'm required to take a Python module for my course and I get this error for my script. It's plotting the trajectory of a projectile and calculating a few other variables. I've type

Solution 1:

As is pointed out in the comments, this is the offending line

i = [i + 1] # increment i for next loop

Here, i is not actually being incremented as the comment suggests. When i is 1, it's being set to [1 + 1], which evaluates to [2], the list containing only the number 2. Remove the brackets.

Post a Comment for "Typeerror: Can Only Concatenate List (not "int") To List 4"