#๐Ÿ”’ anyone know why my dictionary thinks its a tuple?

16 messages ยท Page 1 of 1 (latest)

blazing stirrupBOT
#

@proud forge

Python help channel opened

Remember to:

  • Ask your Python question, not if you can ask or if there's an expert who can help.
  • Show a code sample as text (rather than a screenshot) and the error message, if you've got one.
  • Explain what you expect to happen and what actually happens.

:warning: Do not pip install anything that isn't related to your question, especially if asked to over DMs.

visual rose
#

!paste

blazing stirrupBOT
#
Pasting large amounts of code

If your code is too long to fit in a codeblock in Discord, you can paste your code here:
https://paste.pythondiscord.com/

After pasting your code, save it by clicking the Paste! button in the bottom left, or by pressing CTRL + S. After doing that, you will be navigated to the new paste's page. Copy the URL and post it here so others can see it.

proud forge
#

this is my dictionary

#
  File "c:\Users\corby\Documents\smth.py", line 394, in <module>
    print(search(dict2, "melon"))
          ^^^^^^^^^^^^^^^^^^^^^^
  File "c:\Users\corby\Documents\smth.py", line 366, in search
    for key, value in dictionary.values():
                      ^^^^^^^^^^^^^^^^^
AttributeError: 'tuple' object has no attribute 'values'```
#

this is my error

#

im new to coding so go easy if its a simple mistake please

elfin orchid
#

it seems you have an extra comma on line 346

proud forge
#

oh

#

thank you

#

im so stupid haha

elfin orchid
#

no problem ๐Ÿ‘

proud forge
#

!close

blazing stirrupBOT
#
Python help channel closed

This help channel has been closed and it's no longer possible to send messages here. If your question wasn't answered, feel free to create a new post in #1035199133436354600. To maximize your chances of getting a response, check out this guide on asking good questions.