#๐Ÿ”’ Missing an Instance Variable

33 messages ยท Page 1 of 1 (latest)

stoic moatBOT
#

@gentle flare

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.

gentle flare
#

its inside here

#

AssertionError: GameGrid class is missing at least 1 instance variable

#

I dont know what am I missing

stoic moatBOT
#
Traceback

Please provide the full traceback for your exception in order to help us identify your issue.
While the last line of the error message tells us what kind of error you got,
the full traceback will tell us which line, and other critical information to solve your problem.
Please avoid screenshots so we can copy and paste parts of the message.

A full traceback could look like:

Traceback (most recent call last):
  File "my_file.py", line 5, in <module>
    add_three("6")
  File "my_file.py", line 2, in add_three
    a = num + 3
        ~~~~^~~
TypeError: can only concatenate str (not "int") to str

If the traceback is long, use our pastebin.

stark river
#

Can you provide the full traceback please?

gentle flare
#

AssertionError: GameGrid class is missing at least 1 instance variable

Hide stacktrace
File "/tmp/test.py", line 196, in test_GameGrid_instance_variables
assert hasattr(grid_class, attribute), assertion_msg

#

this is the latest one

#

I submitted via online into my uni portal

stark river
#

And you get the error from the portal when you submit it?

gentle flare
#

yup

stark river
#

Then I can't really help without knowing more about the exact requirements

#

There's probably a fixed name that an instance attribute is supposed to have

#

Which should be mentioned in the assignment

#

I think

gentle flare
#

the def main () onwards are the codes I chatgpt and wrote

stark river
#

The test is testing for a specific instance attribute of the class GameGrid

#

That is evident from the error

#

But it doesn't say which, so it's probably something that was stated in the assignment

#

I can only advise you to read that again

gentle flare
#

The GameGrid Class is from a different file which itself passed all tests but when combined with other I got the errors

#

here is the particular section

#

@stark river any tips ๐Ÿฅฒ

stark river
daring cedar
stoic moatBOT
#
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.