Python Forum
local variable 'marks' referenced before assignment
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
local variable 'marks' referenced before assignment
#3
You have double == which does a comparison
marks == input("Enter for subject " + str(nSubjects + 1) + ": ")
you want a single = to assign
marks = input("Enter for subject " + str(nSubjects + 1) + ": ")
Reply


Messages In This Thread
RE: local variable 'marks' referenced before assignment - by Yoriz - May-25-2020, 02:28 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  creating arbitrary local variable names Skaperen 9 2,048 Sep-07-2024, 12:12 AM
Last Post: Skaperen
  how solve: local variable referenced before assignment ? trix 5 1,916 Jun-15-2024, 07:15 PM
Last Post: trix
  It's saying my global variable is a local variable Radical 5 6,634 Oct-02-2023, 12:57 AM
Last Post: deanhystad
  local varible referenced before assignment SC4R 6 3,402 Jan-10-2023, 10:58 PM
Last Post: snippsat
  UnboundLocalError: local variable 'wmi' referenced before assignment ilknurg 2 3,099 Feb-10-2022, 07:36 PM
Last Post: deanhystad
  Referenced before assignment finndude 3 4,386 Mar-02-2021, 08:11 PM
Last Post: finndude
  ReferenceError: weakly-referenced object no longer exists MrBitPythoner 17 17,007 Dec-14-2020, 07:34 PM
Last Post: buran
  How to instantly add quotation marks and comma for parameters? cheers100 4 12,727 Oct-22-2020, 12:51 PM
Last Post: cheers100
  could someone explain keywords, marks, and function DrKatherineThuyMiller 14 6,939 Jul-23-2020, 07:14 PM
Last Post: DrKatherineThuyMiller
  Assignment of non-existing class variable is accepted - Why? DrZ 6 6,875 Jul-13-2020, 03:53 PM
Last Post: deanhystad

Forum Jump:

User Panel Messages

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