让用户分配列表名称
我正在尝试编写一个程序来跟踪学生所有课程的成绩。学生添加了课程,还添加了课程的不同部分以及它们的权重,这就是我计划使用字典的原因。我一直在使用输入函数来允许用户输入每个段的名称。字典可能看起来像这样: {“作业”:.2,“测试”:.8} 每门课程可能有不同的权重,甚至不同数量的部分。因此,为了跟踪成绩,我想制作一份作业清单和测试清单,学生可以将其成绩输入其中。因此,我希望用户输入的内容是跟踪成绩的列表的名称,这样我就可以将学生的成绩存储在列表中。想法?或者你能想出更好的方法来做到这一点吗?
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 segments 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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
数据结构可以嵌套。
Data structures can be nested.