Python Forum
Invalid syntax defining a dictionary?
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Invalid syntax defining a dictionary?
#7
If you look here and read the docs
@interact() is a decorator for functions

There is no function following your @interact() that can be decorated.
Remove that @ character.

Quote:The @interact is just the same line of code they show in a worked example, and it's worked for a previous exercise. I don't really know what the specific syntax means

Just copy pasting code and not knowing what you are doing is wasting time. Ours and yours.
Reply


Messages In This Thread
Invalid syntax defining a dictionary? - by ep595 - Nov-18-2019, 11:02 PM
RE: Invalid syntax defining a dictionary? - by ThomasL - Nov-19-2019, 08:06 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Invalid syntax Slome 2 2,056 May-13-2022, 08:31 PM
Last Post: Slome
  print(f"{person}:") SyntaxError: invalid syntax when running it AryaIC 11 16,713 Nov-07-2020, 10:17 AM
Last Post: snippsat
  Invalid syntax error, where? tucktuck9 2 3,488 May-03-2020, 09:40 AM
Last Post: pyzyx3qwerty
  Syntax Error: Invalid Syntax in a while loop sydney 1 4,154 Oct-19-2019, 01:40 AM
Last Post: jefsummers
  Help with syntax to sort dictionary by value Mark17 2 2,237 Sep-17-2019, 02:19 PM
Last Post: Mark17
  [split] Please help with SyntaxError: invalid syntax Mason 1 2,252 Apr-28-2019, 06:58 PM
Last Post: Yoriz
  SyntaxError: Invalid syntax in a while loop ludegrae 3 14,886 Dec-18-2018, 04:12 PM
Last Post: Larz60+
  SyntaxError: invalid syntax at run .py tuxo9999 10 7,460 Aug-23-2018, 03:58 PM
Last Post: Axel_Erfurt
  Homework: Invalid syntax using if statements chehortop 3 3,717 Mar-01-2018, 04:38 AM
Last Post: micseydel
  invalid syntax error penlemon 4 3,909 Jan-27-2018, 02:46 PM
Last Post: sparkz_alot

Forum Jump:

User Panel Messages

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