Donate. I desperately need donations to survive due to my health

Get paid by answering surveys Click here

Click here to donate

Remote/Work from Home jobs

My program keeps on saying “unsuccessful”

import random



n=random.randint(1,7)
file=open("artistss.txt","r")
lines=file.readlines()
guess=(lines[n])
x=guess.split("#",2)
print(x[0])

attempt=str(input("please enter the song name with the associated artits with a hash-tag in the middle of the song and artist: "))
if attempt==guess:
    print("you are correct")
else:
    print("unsuccessful")

It keeps on saying that the code is unsuccessful. I think the error has something to do with the split on x.

Comments