Delete not working

I am unable to delete the name of the stu1

Thanks

If we look at the error message put out, the error is gives is this:

File c:\Users\etc… line 11, in <module>
print(stu1.name)

So the error isn’t actually with deletion, it’s with the print call on line 11. The reason being that you have created the class student, however when creating stu1 you haven’t used the correct call to initialise it as a class instance which would be student(name, id, stuclass). As such, stu1 has actually been created as a tuple, which doesn’t have named properties and so stu1.name does not exist. If you rewrite your definition of stu1 to make it a class instance this should fix your issues.

1 Like