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
Post a Comment