Sep-17-2017, 04:14 PM
How to resolve the before error
students = {}; def add_student(name, student_id=332) : student = {"name": name, "student_id": student_id} students.append(student); add_student("Rahul", 12);
Error:Traceback (most recent call last):
File "F:/Python_Projects/first.py", line 11, in <module>
add_student("Rahul", 12);
File "F:/Python_Projects/first.py", line 7, in add_student
students.append(student);
AttributeError: 'dict' object has no attribute 'append'
Process finished with exit code 1