Python Forum
TypeError: unsupported operand type(s) for +: 'dict' and 'int'
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
TypeError: unsupported operand type(s) for +: 'dict' and 'int'
#1
Hello, can anyone explain me why this happens?


Error:
Traceback (most recent call last): File "/Users/nick/Documents/yo.py", line 1661, in <module> eq2= sym.Eq(sqrt((pitchbefx-x1)**2 + (pitchbefy-y1)**2),d+d2) TypeError: unsupported operand type(s) for +: 'dict' and 'int'
Thank you a lot.
Yoriz write Jul-15-2022, 05:12 AM:
Please post all code, output and errors (in their entirety) between their respective tags. Refer to BBCode help topic on how to post. Use the "Preview Post" button to make sure the code is presented as you expect before hitting the "Post Reply/Thread" button.
Reply
#2
The error message is quite clear: you're using + between a dictionary and an integer, which doesn't make sense.

I'd guess d and d2 are those things, but in any case you need to fix that. How you do so depends on what exactly you're trying to do.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
Question TypeError: argument of type 'NoneType' is not iterable Tajaldeen 7 2,473 Nov-29-2024, 09:45 AM
Last Post: Tajaldeen
  Type Error: Unsupported Operand jhancock 2 4,811 Jul-22-2023, 11:33 PM
Last Post: jhancock
  TypeError: unsupported opperand type(s) for %: 'int' and 'list' cool_person 7 3,632 May-07-2022, 08:40 AM
Last Post: ibreeden
  unsupported operand type(s) for %: 'list' and 'int' RandomCoder 4 35,277 May-07-2022, 08:07 AM
Last Post: menator01
  You have any idea, how fix TypeError: unhashable type: 'list' lsepolis123 2 3,920 Jun-02-2021, 07:55 AM
Last Post: supuflounder
  TypeError: __str__ returned non-string (type tuple) Anldra12 1 8,740 Apr-13-2021, 07:50 AM
Last Post: Anldra12
  unsupported operand type(s) for /: 'str' and 'int' Error for boxplot soft 1 3,761 Feb-09-2021, 05:40 PM
Last Post: soft
  What type of *data* is the name of a list/tuple/dict, etc? alloydog 9 5,989 Jan-30-2021, 07:11 AM
Last Post: alloydog
Question dict value, how to change type from int to list? swissjoker 3 3,538 Dec-09-2020, 09:50 AM
Last Post: perfringo
  TypeError: 'type' object is not subscriptable Stef 1 6,662 Aug-28-2020, 03:01 PM
Last Post: Gribouillis

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020