How to add a class instance from user input in python?
<pre><code>class Student(object):
    def __init__(self, name, chinese = 0, math = 0, english = 0):
        self.name = name
        self.chinese = chinese
        self.math = math
        self.english = english
        self.total = self.chinese + self.math + self.english
        Student.list.append(name)'
</code></pre>

<p>I'm trying to write a grade management system, all the student's score are stored in classes of their name. How can I add new instances to the class Student based on user input?</p>

<pre><code>    name = raw_input("Please input the student's name:")
    chinese = input("Please input Chinese score:")
    math = input("Please input Math score:")
    english = input("Please input English score:")
    name = Student(name, chinese, math, english)
    # eval(name)
    # name = Student(name, chinese, math, english)
</code></pre>

<p>I've tried with these method but nothing works out.</p>

<pre><code>import pprint
class Student():
#blah blah blah

if __name__ == "__main__":
    list_of_students = []
    while True:
        if raw_input("Add student? (y/n)") == "n":
            break
        # ask your questions here
        list_of_students.append( Student( # student data ) )
    for student in list_of_students:
        pprint.pprint(student.__dict__)
</code></pre>

python