This is my code, i feel like the problem is in the *** bit. The error is just that it instead of outputting "well done", it outputs "sorry its wrong") Even when the input is correct
x = random.randint(0,3)
artisttextfile = open("artist.txt" , "r")
randomartist = artisttextfile.readlines()
print("The name of the artist is called " + randomartist[x])
artisttextfile.close()
songtextfile= open("songs.txt" , "r")
randomsong = songtextfile.readlines()
string=(randomsong[x])
songtextfile.close()
print("The first letter of the song is " + string[0])
answer=input("What is the name of the song?")
if answer == string: # this line
print("Well done")
else:
print("sorry its wrong")
print("Try again")