This is part of my code for a simple music quiz. However, file.readline() returns an empty space whenever I run it. There is a text file called storage.txt with the data in it. I have tried using file.seek(), file.read(), and file.readlines() but none so far have allowed me to print a specific line.
points = 0
question_number = 0
file = open("storage.txt","r")
while True:
question_number = question_number + 1
keyword = file.readline(question_number)
print("Who made this song?")
answer = input(keyword)
if answer == file.readline(question_number+1):
print("You got it right, 1 point for you!")
points += 1
else:
print("You lost with",points,"points.")
break
file.close()
print("All done.")