Say I have a .txt file. The file contains alternating lines of words and numbers:
Mary
156
Sue
160
Jenn
154
I want to put these alternating lines into a dictionary like ('Mary': 156). My first thought was to use a for-loop with the % operator but I'm still stuck on actual implementation. Is it possible to index lines in a text file? What my train of thought is so far:
for i in range(len(text)):
if i%2 == 0