[Solved] How to create a dictionary python [closed]


According your question and your comment, I assume you have no problem with the text and input. So the point is how to split up mark and grade?

You can use zip() to do this

# This is an example for Josh, assuming you already have list call lines,
# lines = [(mark1, grad1), (mark2, grade2)......]
marks, grades = zip(*lines) # marks is a tuple of marks, grades is a tuple of grades.

There you go

By the way, the split() function will automatically strip '\n'

4

solved How to create a dictionary python [closed]