开发者

Letting the User Assign List Names

I am trying to write a program that will keep track of a student's grades in all of his courses. The student adds the course and also adds the different s开发者_运维技巧egments of the course and how they are weighted, which is why I was planning on using a dictionary. I've been using an input function to allow the user to enter the name of each segment. The dictionary might look like this: {"homework": .2, "tests": .8} Each course might have different weightings or even a different number of segments. So to keep track of the grades I want to make a homework list and a tests list that the student can enter his grades into. Therefore, I want what the user enters to be the name of the list that keeps track of the grades, so I can store the students grades in a list. Thoughts? Or can you think of a better way of doing this?


Data structures can be nested.

{'mylist': [], 'awesomedict': {}}
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜