The problem is in this if condition
Let's see what will happen when counter = 0 (i.e., first question/answer)
on line 18 you will print a randomly selected song from the list. It could be any song of the list, e.g. let's say it is the third one. Here you want to print just the first letter I guess, but anyway. You also need to save this randomly selected song to a variable in order to be able to check user answer. Instead you compare the user answer with the first song in the list (i.e. the one with index 0). Even if you answered correctly if condition will be False. In next iteration of the loop counter will still be 0 and you will compare user input with the first song in the list. But randomly selected song would be different.
There are other problems in your code and logic
repetitive code when you read line by line from the file
there are better ways to open file, e.g. using
as it is now it's possible to get same song many times (i.e. ask same question multiple times)
if answer == songs[counter]:
.Let's see what will happen when counter = 0 (i.e., first question/answer)
on line 18 you will print a randomly selected song from the list. It could be any song of the list, e.g. let's say it is the third one. Here you want to print just the first letter I guess, but anyway. You also need to save this randomly selected song to a variable in order to be able to check user answer. Instead you compare the user answer with the first song in the list (i.e. the one with index 0). Even if you answered correctly if condition will be False. In next iteration of the loop counter will still be 0 and you will compare user input with the first song in the list. But randomly selected song would be different.
There are other problems in your code and logic
repetitive code when you read line by line from the file
there are better ways to open file, e.g. using
with
context manageras it is now it's possible to get same song many times (i.e. ask same question multiple times)
If you can't explain it to a six year old, you don't understand it yourself, Albert Einstein
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs