Aaron Banerjee
Aaron Banerjee
5,487 Points

python issue with shopping list 3

posistion = abs(int(posistion))
  except ValueError:
    position = None
  if posistion is not None:

workspaces is saying there is an issue with the line 'shopping_list.insert(posistion-1,item) ' because unsupported operand type for -: 'str and int can someone please help me figure this out

1 Answer

Steven Parker
Steven Parker
146,309 Points

I'll disregard the fact that this code isn't complete for the moment, but from just what's shown here there is inconsistent spelling of a variable: "position" (normal spelling) and also "posistion" (with an extra "s").

The spelling itself doesn't matter to the functionality, but it must be consistent throughout the program.